You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ReferenceTypeDelegate.java 3.5KB

15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
14 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
15 years ago
14 years ago
14 years ago
14 years ago
14 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /* *******************************************************************
  2. * Copyright (c) 2002 Contributors
  3. * All rights reserved.
  4. * This program and the accompanying materials are made available
  5. * under the terms of the Eclipse Public License v 2.0
  6. * which accompanies this distribution and is available at
  7. * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
  8. *
  9. * Contributors:
  10. * PARC initial implementation
  11. * Andy Clement - June 2005 - separated out from ResolvedType
  12. * ******************************************************************/
  13. package org.aspectj.weaver;
  14. import java.util.Collection;
  15. import org.aspectj.weaver.AjAttribute.WeaverVersionInfo;
  16. import org.aspectj.weaver.patterns.Declare;
  17. import org.aspectj.weaver.patterns.PerClause;
  18. /**
  19. * Abstraction over a type - a reference type is Object or a descendant of Object, other types (int/etc) are considered primitive
  20. * types. Abstract implementation provided by AbstractReferenceTypeDelegate.
  21. */
  22. public interface ReferenceTypeDelegate {
  23. boolean isAspect();
  24. /**
  25. * @return true if the type is an annotation style aspect (a type marked @Aspect)
  26. */
  27. boolean isAnnotationStyleAspect();
  28. boolean isInterface();
  29. boolean isEnum();
  30. boolean isAnnotation();
  31. String getRetentionPolicy();
  32. /**
  33. * @return true if this annotation type can be on a regular type (ie. it doesn't specify anything or it specifies TYPE)
  34. */
  35. boolean canAnnotationTargetType();
  36. /**
  37. * @return all the possible targets that this annotation can be placed upon
  38. */
  39. AnnotationTargetKind[] getAnnotationTargetKinds();
  40. /**
  41. * @return true if this annotation type has a retention policy of RUNTIME
  42. */
  43. boolean isAnnotationWithRuntimeRetention();
  44. boolean isClass();
  45. boolean isGeneric();
  46. boolean isAnonymous();
  47. /**
  48. * @return true if this class is nested (this includes: member classes, local classes, anonymous classes)
  49. */
  50. boolean isNested();
  51. boolean hasAnnotation(UnresolvedType ofType);
  52. AnnotationAJ[] getAnnotations();
  53. ResolvedType[] getAnnotationTypes();
  54. ResolvedMember[] getDeclaredFields();
  55. ResolvedType[] getDeclaredInterfaces();
  56. ResolvedMember[] getDeclaredMethods();
  57. ResolvedMember[] getDeclaredPointcuts();
  58. TypeVariable[] getTypeVariables();
  59. int getModifiers();
  60. // aspect declaration related members
  61. /**
  62. * @return for an aspect declaration, return the
  63. */
  64. PerClause getPerClause();
  65. Collection<Declare> getDeclares();
  66. Collection<ConcreteTypeMunger> getTypeMungers();
  67. Collection<ResolvedMember> getPrivilegedAccesses();
  68. // end of aspect declaration related members
  69. ResolvedType getSuperclass();
  70. WeaverStateInfo getWeaverState();
  71. ReferenceType getResolvedTypeX();
  72. // needs renaming isWeavable or removing from here
  73. boolean isExposedToWeaver();
  74. boolean doesNotExposeShadowMungers();
  75. ISourceContext getSourceContext();
  76. String getSourcefilename();
  77. String getDeclaredGenericSignature();
  78. ResolvedType getOuterClass();
  79. boolean copySourceContext();
  80. /**
  81. * TODO Caching of methods besides getDeclaredInterfaces() may also be dependent on this flag - which?
  82. *
  83. * @return true if something the result of getDeclaredInterfaces() can be cached by the caller
  84. */
  85. boolean isCacheable();
  86. /**
  87. * If known, return the compiler/weaver version used to build this delegate. Default is the most recent level as specified in
  88. * {@link WeaverVersionInfo}.
  89. *
  90. * @return the major version
  91. */
  92. int getCompilerVersion();
  93. /**
  94. * Implementations need to clear state
  95. */
  96. void ensureConsistent();
  97. boolean isWeavable();
  98. boolean hasBeenWoven();
  99. boolean hasAnnotations();
  100. }