org.aspectj.ajdt.internal.compiler.lookup
Class EclipseSourceType

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

public class EclipseSourceType
extends AbstractReferenceTypeDelegate

Supports viewing eclipse TypeDeclarations/SourceTypeBindings as a ResolvedType


Field Summary
static short ACC_ANNOTATION
           
static short ACC_ENUM
           
protected  ResolvedMember[] declaredFields
           
protected  ResolvedMember[] declaredMethods
           
protected  ResolvedPointcutDefinition[] declaredPointcuts
           
 java.util.List<Declare> declares
           
 java.util.List<EclipseTypeMunger> typeMungers
           
 
Fields inherited from class org.aspectj.weaver.AbstractReferenceTypeDelegate
cachedGenericClassTypeSignature, exposedToWeaver, resolvedTypeX, UNKNOWN_SOURCE_FILE
 
Constructor Summary
EclipseSourceType(ReferenceType resolvedTypeX, EclipseFactory factory, SourceTypeBinding binding, TypeDeclaration declaration, CompilationUnitDeclaration unit)
           
 
Method Summary
 boolean canAnnotationTargetType()
           
 void checkPointcutDeclarations()
           
 AnnotationAJ convertEclipseAnnotation(Annotation eclipseAnnotation, World w)
          Convert one eclipse annotation into an AnnotationX object containing an AnnotationAJ object.
 boolean doesNotExposeShadowMungers()
          Designed to be overriden by EclipseType to disable collection of shadow mungers during pre-weave compilation phase
protected  EclipseFactory eclipseWorld()
           
protected  void fillDeclaredMembers()
           
 AnnotationAJ[] getAnnotations()
          WARNING: This method does not have a complete implementation.
 AnnotationTargetKind[] getAnnotationTargetKinds()
           
 ResolvedType[] getAnnotationTypes()
           
 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
 java.lang.String getDeclaredGenericSignature()
           
 ResolvedType[] getDeclaredInterfaces()
           
 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
 ResolvedMember[] getDeclaredPointcuts()
           
 java.util.Collection getDeclares()
           
 int getModifiers()
           
 ResolvedType getOuterClass()
           
 PerClause getPerClause()
           
 java.util.Collection getPrivilegedAccesses()
           
 java.lang.String getRetentionPolicy()
           
 ResolvedType getSuperclass()
           
 java.util.Collection getTypeMungers()
           
 TypeVariable[] getTypeVariables()
           
 WeaverStateInfo getWeaverState()
           
 boolean hasAnnotation(UnresolvedType ofType)
           
 boolean isAnnotation()
           
 boolean isAnnotationStyleAspect()
           
 boolean isAnnotationWithRuntimeRetention()
           
 boolean isAnonymous()
           
 boolean isAspect()
           
 boolean isEnum()
           
 boolean isGeneric()
           
 boolean isInterface()
           
 boolean isNested()
           
 java.lang.String toString()
           
 
Methods inherited from class org.aspectj.weaver.AbstractReferenceTypeDelegate
copySourceContext, ensureConsistent, getCompilerVersion, getFormalTypeParametersFromOuterClass, getGenericClassTypeSignature, getResolvedTypeX, getSourceContext, getSourcefilename, getSourceLocation, hasBeenWoven, isCacheable, isClass, isExposedToWeaver, isWeavable, setSourceContext, setSourcefilename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

declaredPointcuts

protected ResolvedPointcutDefinition[] declaredPointcuts

declaredMethods

protected ResolvedMember[] declaredMethods

declaredFields

protected ResolvedMember[] declaredFields

declares

public java.util.List<Declare> declares

typeMungers

public java.util.List<EclipseTypeMunger> typeMungers

ACC_ANNOTATION

public static final short ACC_ANNOTATION
See Also:
Constant Field Values

ACC_ENUM

public static final short ACC_ENUM
See Also:
Constant Field Values
Constructor Detail

EclipseSourceType

public EclipseSourceType(ReferenceType resolvedTypeX,
                         EclipseFactory factory,
                         SourceTypeBinding binding,
                         TypeDeclaration declaration,
                         CompilationUnitDeclaration unit)
Method Detail

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 java.lang.String toString()
Overrides:
toString in class java.lang.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 java.lang.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).


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 java.util.Collection getDeclares()

getPrivilegedAccesses

public java.util.Collection getPrivilegedAccesses()

getTypeMungers

public java.util.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 java.lang.String getDeclaredGenericSignature()

isGeneric

public boolean isGeneric()

getTypeVariables

public TypeVariable[] getTypeVariables()