1. /*
  2. * Copyright 2003-2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.apache.commons.attributes;
  17. import java.util.Set;
  18. import java.util.Map;
  19. /**
  20. * Interface implemented by all attribute repository classes.
  21. * This interface is used internally and should not be used
  22. * by clients. The only reason it is public is because the
  23. * classes implementing it may be in any package.
  24. */
  25. public interface AttributeRepositoryClass {
  26. /**
  27. * Returns a set containing all attributes (instances) associated with this class.
  28. * Should not return any attributes of superclasses etc.
  29. */
  30. public Set getClassAttributes ();
  31. /**
  32. * Returns a map with String keys and Set values. The keys correspond to field names,
  33. * and their associated Set values are the set of all attributes (instances) associated with that field.
  34. * Should not return any attributes of superclasses etc.
  35. */
  36. public Map getFieldAttributes ();
  37. /**
  38. * Returns a map with String keys and List values. The keys correspond to method signatures,
  39. * given by get Util.getSignature method, and the lists are as follows:<p>
  40. *
  41. * list.get(0) = A Set with the attributes associated with the method.<p>
  42. * list.get(1) = A Set with the attributes associated with the method's return value.<p>
  43. * list.get(2) = A Set with the attributes associated with the method's first parameter.<p>
  44. * list.get(n) = A Set with the attributes associated with the method's (n - 1) th parameter.<p>
  45. *
  46. * All slots in the list must be filled, not just those where there are attributes.
  47. *
  48. * Should not return any attributes of superclasses etc.
  49. */
  50. public Map getMethodAttributes ();
  51. /**
  52. * Returns a map with String keys and List values. The keys correspond to constructor signatures,
  53. * given by get Util.getSignature method, and the lists are as follows:<p>
  54. *
  55. * list.get(0) = A Set with the attributes associated with the constructor.<p>
  56. * list.get(1) = A Set with the attributes associated with the constructor's first parameter.<p>
  57. * list.get(n) = A Set with the attributes associated with the constructor's (n - 1) th parameter.<p>
  58. *
  59. * All slots in the list must be filled, not just those where there are attributes.
  60. *
  61. * Should not return any attributes of superclasses etc.
  62. */
  63. public Map getConstructorAttributes ();
  64. }