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.8KB

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 v1.0
  6. * which accompanies this distribution and is available at
  7. * http://www.eclipse.org/legal/epl-v10.html
  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. public boolean isAspect();
  24. /**
  25. * @return true if the type is an annotation style aspect (a type marked @Aspect)
  26. */
  27. public boolean isAnnotationStyleAspect();
  28. public boolean isInterface();
  29. public boolean isEnum();
  30. public boolean isAnnotation();
  31. public 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. public boolean canAnnotationTargetType();
  36. /**
  37. * @return all the possible targets that this annotation can be placed upon
  38. */
  39. public AnnotationTargetKind[] getAnnotationTargetKinds();
  40. /**
  41. * @return true if this annotation type has a retention policy of RUNTIME
  42. */
  43. public boolean isAnnotationWithRuntimeRetention();
  44. public boolean isClass();
  45. public boolean isGeneric();
  46. public boolean isAnonymous();
  47. /**
  48. * @return true if this class is nested (this includes: member classes, local classes, anonymous classes)
  49. */
  50. public boolean isNested();
  51. public boolean hasAnnotation(UnresolvedType ofType);
  52. public AnnotationAJ[] getAnnotations();
  53. public ResolvedType[] getAnnotationTypes();
  54. public ResolvedMember[] getDeclaredFields();
  55. public ResolvedType[] getDeclaredInterfaces();
  56. public ResolvedMember[] getDeclaredMethods();
  57. public ResolvedMember[] getDeclaredPointcuts();
  58. public TypeVariable[] getTypeVariables();
  59. public int getModifiers();
  60. // aspect declaration related members
  61. /**
  62. * @return for an aspect declaration, return the
  63. */
  64. public PerClause getPerClause();
  65. public Collection<Declare> getDeclares();
  66. public Collection<ConcreteTypeMunger> getTypeMungers();
  67. public Collection<ResolvedMember> getPrivilegedAccesses();
  68. // end of aspect declaration related members
  69. public ResolvedType getSuperclass();
  70. public WeaverStateInfo getWeaverState();
  71. public ReferenceType getResolvedTypeX();
  72. // needs renaming isWeavable or removing from here
  73. public boolean isExposedToWeaver();
  74. public boolean doesNotExposeShadowMungers();
  75. public ISourceContext getSourceContext();
  76. public String getSourcefilename();
  77. public String getDeclaredGenericSignature();
  78. public ResolvedType getOuterClass();
  79. public 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. public 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. public int getCompilerVersion();
  93. /**
  94. * Implementations need to clear state
  95. */
  96. public void ensureConsistent();
  97. public boolean isWeavable();
  98. public boolean hasBeenWoven();
  99. public boolean hasAnnotations();
  100. }