Class EclipseSourceType

java.lang.Object
org.aspectj.weaver.AbstractReferenceTypeDelegate
org.aspectj.ajdt.internal.compiler.lookup.EclipseSourceType
All Implemented Interfaces:
ReferenceTypeDelegate

public class EclipseSourceType extends AbstractReferenceTypeDelegate
Supports viewing eclipse TypeDeclarations/SourceTypeBindings as a ResolvedType
Author:
Jim Hugunin, Andy Clement
  • Field Details

  • Constructor Details

  • Method Details

    • eclipseWorld

      protected EclipseFactory eclipseWorld()
    • isAspect

      public boolean isAspect()
    • isAnonymous

      public boolean isAnonymous()
    • isNested

      public boolean isNested()
      Returns:
      true if this class is nested (this includes: member classes, local classes, anonymous classes)
    • getOuterClass

      public ResolvedType getOuterClass()
    • isAnnotationStyleAspect

      public boolean isAnnotationStyleAspect()
      Returns:
      true if the type is an annotation style aspect (a type marked @Aspect)
    • getWeaverState

      public WeaverStateInfo getWeaverState()
    • getSuperclass

      public ResolvedType getSuperclass()
    • getDeclaredInterfaces

      public ResolvedType[] getDeclaredInterfaces()
    • fillDeclaredMembers

      protected void fillDeclaredMembers()
    • getDeclaredFields

      public ResolvedMember[] getDeclaredFields()
      This method may not return all fields, for example it may not include the ajc$initFailureCause or ajc$perSingletonInstance fields - see bug 129613
    • getDeclaredMethods

      public ResolvedMember[] getDeclaredMethods()
      This method may not return all methods, for example it may not include clinit, aspectOf, hasAspect or ajc$postClinit methods - see bug 129613
    • getDeclaredPointcuts

      public ResolvedMember[] getDeclaredPointcuts()
    • getModifiers

      public int getModifiers()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • checkPointcutDeclarations

      public void checkPointcutDeclarations()
    • isInterface

      public boolean isInterface()
    • isEnum

      public boolean isEnum()
    • isAnnotation

      public boolean isAnnotation()
    • isAnnotationWithRuntimeRetention

      public boolean isAnnotationWithRuntimeRetention()
      Returns:
      true if this annotation type has a retention policy of RUNTIME
    • getRetentionPolicy

      public String getRetentionPolicy()
    • canAnnotationTargetType

      public boolean canAnnotationTargetType()
      Returns:
      true if this annotation type can be on a regular type (ie. it doesn't specify anything or it specifies TYPE)
    • getAnnotationTargetKinds

      public AnnotationTargetKind[] getAnnotationTargetKinds()
      Returns:
      all the possible targets that this annotation can be placed upon
    • hasAnnotation

      public boolean hasAnnotation(UnresolvedType ofType)
    • getAnnotations

      public AnnotationAJ[] getAnnotations()
      WARNING: This method does not have a complete implementation. The aim is that it converts Eclipse annotation objects to the AspectJ form of annotations (the type AnnotationAJ). The AnnotationX objects returned are wrappers over either a Bcel annotation type or the AspectJ AnnotationAJ type. The minimal implementation provided here is for processing the RetentionPolicy and Target annotation types - these are the only ones which the weaver will attempt to process from an EclipseSourceType. More notes: The pipeline has required us to implement this. With the pipeline we can be weaving a type and asking questions of annotations before they have been turned into Bcel objects - ie. when they are still in EclipseSourceType form. Without the pipeline we would have converted everything to Bcel objects before proceeding with weaving. Because the pipeline won't start weaving until all aspects have been compiled and the fact that no AspectJ constructs match on the values within annotations, this code only needs to deal with converting system annotations that the weaver needs to process (RetentionPolicy, Target).
    • hasAnnotations

      public boolean hasAnnotations()
    • convertEclipseAnnotation

      public AnnotationAJ convertEclipseAnnotation(Annotation eclipseAnnotation, World w)
      Convert one eclipse annotation into an AnnotationX object containing an AnnotationAJ object. This code and the helper methods used by it will go *BANG* if they encounter anything not currently supported - this is safer than limping along with a malformed annotation. When the *BANG* is encountered the bug reporter should indicate the kind of annotation they were working with and this code can be enhanced to support it.
    • getAnnotationTypes

      public ResolvedType[] getAnnotationTypes()
    • getPerClause

      public PerClause getPerClause()
      Returns:
      for an aspect declaration, return the
    • getDeclares

      public Collection<Declare> getDeclares()
    • getPrivilegedAccesses

      public Collection<ResolvedMember> getPrivilegedAccesses()
    • getTypeMungers

      public Collection getTypeMungers()
    • doesNotExposeShadowMungers

      public boolean doesNotExposeShadowMungers()
      Description copied from class: AbstractReferenceTypeDelegate
      Designed to be overriden by EclipseType to disable collection of shadow mungers during pre-weave compilation phase
      Specified by:
      doesNotExposeShadowMungers in interface ReferenceTypeDelegate
      Overrides:
      doesNotExposeShadowMungers in class AbstractReferenceTypeDelegate
    • getDeclaredGenericSignature

      public String getDeclaredGenericSignature()
    • isGeneric

      public boolean isGeneric()
    • getTypeVariables

      public TypeVariable[] getTypeVariables()