org.aspectj.weaver
Class AjcMemberMaker

java.lang.Object
  extended by org.aspectj.weaver.AjcMemberMaker

public class AjcMemberMaker
extends java.lang.Object

The AjcMemberMaker is responsible for creating the representations of methods/fields/etc that are placed in both aspects and affected target types. It uses the NameMangler class to create the actual names that will be used.


Field Summary
static UnresolvedType AFTER_ANNOTATION
           
static UnresolvedType AFTERRETURNING_ANNOTATION
           
static UnresolvedType AFTERTHROWING_ANNOTATION
           
static UnresolvedType AROUND_ANNOTATION
           
static UnresolvedType AROUND_CLOSURE_TYPE
           
static UnresolvedType ASPECT_ANNOTATION
           
static UnresolvedType BEFORE_ANNOTATION
           
static UnresolvedType CFLOW_STACK_TYPE
           
static UnresolvedType CONVERSIONS_TYPE
           
static UnresolvedType DECLAREERROR_ANNOTATION
           
static UnresolvedType DECLAREMIXIN_ANNOTATION
           
static UnresolvedType DECLAREPARENTS_ANNOTATION
           
static UnresolvedType DECLAREPRECEDENCE_ANNOTATION
           
static UnresolvedType DECLAREWARNING_ANNOTATION
           
static UnresolvedType NO_ASPECT_BOUND_EXCEPTION
           
static UnresolvedType POINTCUT_ANNOTATION
           
static UnresolvedType TYPEX_ENCLOSINGSTATICJOINPOINT
           
static UnresolvedType TYPEX_JOINPOINT
           
static UnresolvedType TYPEX_PROCEEDINGJOINPOINT
           
static UnresolvedType TYPEX_STATICJOINPOINT
           
 
Constructor Summary
AjcMemberMaker()
           
 
Method Summary
static ResolvedMember ajcPostClinitMethod(UnresolvedType declaringType)
           
static ResolvedMember ajcPreClinitMethod(UnresolvedType declaringType)
           
static Member aroundClosurePreInitializationField()
           
static Member aroundClosurePreInitializationGetter()
           
static ResolvedMember bridgerToInterMethod(ResolvedMember meth, UnresolvedType aspectType)
          Sometimes the intertyped method requires a bridge method alongside it.
static Member cflowStackInit()
           
static Member cflowStackIsValid()
           
static Member cflowStackPeekInstance()
           
static Member cflowStackPushInstance()
           
static ResolvedMember initFailureCauseField(UnresolvedType declaringType)
           
static ResolvedMember inlineAccessMethodForFieldGet(UnresolvedType aspectType, Member field)
           
static ResolvedMember inlineAccessMethodForFieldSet(UnresolvedType aspectType, Member field)
           
static ResolvedMember inlineAccessMethodForMethod(UnresolvedType aspectType, ResolvedMember method)
           
static ResolvedMember interConstructor(ResolvedType targetType, ResolvedMember constructor, UnresolvedType aspectType)
           
static Member interfaceConstructor(ResolvedType resolvedTypeX)
           
static ResolvedMember interFieldClassField(ResolvedMember field, UnresolvedType aspectType, boolean newStyle)
          This field goes on the class the field is declared onto.
static ResolvedMember interFieldGetDispatcher(ResolvedMember field, UnresolvedType aspectType)
          This static method goes on the aspect that declares the inter-type field
static ResolvedMember interFieldInitializer(ResolvedMember field, UnresolvedType aspectType)
           
static ResolvedMember interFieldInterfaceField(ResolvedMember field, UnresolvedType onClass, UnresolvedType aspectType, boolean newStyle)
          This field goes on top-most implementers of the interface the field is declared onto
static ResolvedMember interFieldInterfaceGetter(ResolvedMember field, ResolvedType onType, UnresolvedType aspectType)
          This instance method goes on the interface the field is declared onto as well as its top-most implementors
static ResolvedMember interFieldInterfaceSetter(ResolvedMember field, ResolvedType onType, UnresolvedType aspectType)
          This instance method goes on the interface the field is declared onto as well as its top-most implementors
static ResolvedMember interFieldSetDispatcher(ResolvedMember field, UnresolvedType aspectType)
          This static method goes on the aspect that declares the inter-type field
static ResolvedMember interMethod(ResolvedMember meth, UnresolvedType aspectType, boolean onInterface)
          This method goes on the target type of the inter-type method.
static ResolvedMember interMethodBody(ResolvedMember meth, UnresolvedType aspectType)
          This method goes on the declaring aspect of the inter-type method.
static ResolvedMember interMethodBridger(ResolvedMember meth, UnresolvedType aspectType, boolean onInterface)
          This method goes on the target type of the inter-type method.
static ResolvedMember interMethodDispatcher(ResolvedMember meth, UnresolvedType aspectType)
          This static method goes on the declaring aspect of the inter-type method.
static ResolvedMember itdAtDeclareParentsField(ResolvedType targetType, UnresolvedType itdType, UnresolvedType aspectType)
           
static Member noAspectBoundExceptionInit()
           
static Member noAspectBoundExceptionInit2()
           
static Member noAspectBoundExceptionInitWithCause()
           
static ResolvedMember perCflowAspectOfMethod(UnresolvedType declaringType)
           
static ResolvedMember perCflowField(UnresolvedType declaringType)
           
static ResolvedMember perCflowHasAspectMethod(UnresolvedType declaringType)
           
static ResolvedMember perCflowPush(UnresolvedType declaringType)
           
static ResolvedMember perObjectAspectOfMethod(UnresolvedType declaringType)
           
static ResolvedMember perObjectBind(UnresolvedType declaringType)
           
static ResolvedMember perObjectField(UnresolvedType declaringType, ResolvedType aspectType)
           
static ResolvedMember perObjectHasAspectMethod(UnresolvedType declaringType)
           
static ResolvedMember perObjectInterfaceGet(UnresolvedType aspectType)
           
static ResolvedMember perObjectInterfaceSet(UnresolvedType aspectType)
           
static UnresolvedType perObjectInterfaceType(UnresolvedType aspectType)
           
static ResolvedMember perSingletonAspectOfMethod(UnresolvedType declaringType)
           
static ResolvedMember perSingletonField(UnresolvedType declaringType)
           
static ResolvedMember perSingletonHasAspectMethod(UnresolvedType declaringType)
           
static ResolvedMember perTypeWithinAspectOfMethod(UnresolvedType declaringType, boolean inJava5Mode)
           
static ResolvedMember perTypeWithinCreateAspectInstance(UnresolvedType declaringType)
           
static ResolvedMember perTypeWithinField(UnresolvedType declaringType, ResolvedType aspectType)
           
static ResolvedMember perTypeWithinGetInstance(UnresolvedType declaringType)
           
static ResolvedMember perTypeWithinGetWithinTypeNameMethod(UnresolvedType declaringType, boolean inJava5Mode)
           
static ResolvedMember perTypeWithinHasAspectMethod(UnresolvedType declaringType, boolean inJava5Mode)
           
static ResolvedMember perTypeWithinLocalAspectOf(UnresolvedType shadowType, UnresolvedType aspectType)
           
static ResolvedMember perTypeWithinWithinTypeField(UnresolvedType declaringType, ResolvedType aspectType)
           
static ResolvedMember postIntroducedConstructor(UnresolvedType aspectType, UnresolvedType targetType, UnresolvedType[] paramTypes)
           
static ResolvedMember preIntroducedConstructor(UnresolvedType aspectType, UnresolvedType targetType, UnresolvedType[] paramTypes)
           
static ResolvedMember privilegedAccessMethodForFieldGet(UnresolvedType aspectType, Member field, boolean shortSyntax)
          Return a resolvedmember representing the synthetic getter for the field.
static ResolvedMember privilegedAccessMethodForFieldSet(UnresolvedType aspectType, Member field, boolean shortSyntax)
          Return a resolvedmember representing the synthetic setter for the field.
static ResolvedMember privilegedAccessMethodForMethod(UnresolvedType aspectType, ResolvedMember method)
           
static ResolvedMember superAccessMethod(UnresolvedType baseType, ResolvedMember method)
           
static ResolvedMember toObjectConversionMethod(UnresolvedType fromType)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CFLOW_STACK_TYPE

public static final UnresolvedType CFLOW_STACK_TYPE

AROUND_CLOSURE_TYPE

public static final UnresolvedType AROUND_CLOSURE_TYPE

CONVERSIONS_TYPE

public static final UnresolvedType CONVERSIONS_TYPE

NO_ASPECT_BOUND_EXCEPTION

public static final UnresolvedType NO_ASPECT_BOUND_EXCEPTION

ASPECT_ANNOTATION

public static final UnresolvedType ASPECT_ANNOTATION

BEFORE_ANNOTATION

public static final UnresolvedType BEFORE_ANNOTATION

AROUND_ANNOTATION

public static final UnresolvedType AROUND_ANNOTATION

AFTERRETURNING_ANNOTATION

public static final UnresolvedType AFTERRETURNING_ANNOTATION

AFTERTHROWING_ANNOTATION

public static final UnresolvedType AFTERTHROWING_ANNOTATION

AFTER_ANNOTATION

public static final UnresolvedType AFTER_ANNOTATION

POINTCUT_ANNOTATION

public static final UnresolvedType POINTCUT_ANNOTATION

DECLAREERROR_ANNOTATION

public static final UnresolvedType DECLAREERROR_ANNOTATION

DECLAREWARNING_ANNOTATION

public static final UnresolvedType DECLAREWARNING_ANNOTATION

DECLAREPRECEDENCE_ANNOTATION

public static final UnresolvedType DECLAREPRECEDENCE_ANNOTATION

DECLAREPARENTS_ANNOTATION

public static final UnresolvedType DECLAREPARENTS_ANNOTATION

DECLAREMIXIN_ANNOTATION

public static final UnresolvedType DECLAREMIXIN_ANNOTATION

TYPEX_JOINPOINT

public static final UnresolvedType TYPEX_JOINPOINT

TYPEX_PROCEEDINGJOINPOINT

public static final UnresolvedType TYPEX_PROCEEDINGJOINPOINT

TYPEX_STATICJOINPOINT

public static final UnresolvedType TYPEX_STATICJOINPOINT

TYPEX_ENCLOSINGSTATICJOINPOINT

public static final UnresolvedType TYPEX_ENCLOSINGSTATICJOINPOINT
Constructor Detail

AjcMemberMaker

public AjcMemberMaker()
Method Detail

ajcPreClinitMethod

public static ResolvedMember ajcPreClinitMethod(UnresolvedType declaringType)

ajcPostClinitMethod

public static ResolvedMember ajcPostClinitMethod(UnresolvedType declaringType)

noAspectBoundExceptionInit

public static Member noAspectBoundExceptionInit()

noAspectBoundExceptionInit2

public static Member noAspectBoundExceptionInit2()

noAspectBoundExceptionInitWithCause

public static Member noAspectBoundExceptionInitWithCause()

perCflowPush

public static ResolvedMember perCflowPush(UnresolvedType declaringType)

perCflowField

public static ResolvedMember perCflowField(UnresolvedType declaringType)

perSingletonField

public static ResolvedMember perSingletonField(UnresolvedType declaringType)

initFailureCauseField

public static ResolvedMember initFailureCauseField(UnresolvedType declaringType)

perObjectField

public static ResolvedMember perObjectField(UnresolvedType declaringType,
                                            ResolvedType aspectType)

perTypeWithinField

public static ResolvedMember perTypeWithinField(UnresolvedType declaringType,
                                                ResolvedType aspectType)

perTypeWithinWithinTypeField

public static ResolvedMember perTypeWithinWithinTypeField(UnresolvedType declaringType,
                                                          ResolvedType aspectType)

perObjectBind

public static ResolvedMember perObjectBind(UnresolvedType declaringType)

perTypeWithinGetInstance

public static ResolvedMember perTypeWithinGetInstance(UnresolvedType declaringType)

perTypeWithinGetWithinTypeNameMethod

public static ResolvedMember perTypeWithinGetWithinTypeNameMethod(UnresolvedType declaringType,
                                                                  boolean inJava5Mode)

perTypeWithinCreateAspectInstance

public static ResolvedMember perTypeWithinCreateAspectInstance(UnresolvedType declaringType)

perObjectInterfaceType

public static UnresolvedType perObjectInterfaceType(UnresolvedType aspectType)

perObjectInterfaceGet

public static ResolvedMember perObjectInterfaceGet(UnresolvedType aspectType)

perObjectInterfaceSet

public static ResolvedMember perObjectInterfaceSet(UnresolvedType aspectType)

perTypeWithinLocalAspectOf

public static ResolvedMember perTypeWithinLocalAspectOf(UnresolvedType shadowType,
                                                        UnresolvedType aspectType)

perSingletonAspectOfMethod

public static ResolvedMember perSingletonAspectOfMethod(UnresolvedType declaringType)

perSingletonHasAspectMethod

public static ResolvedMember perSingletonHasAspectMethod(UnresolvedType declaringType)

perCflowAspectOfMethod

public static ResolvedMember perCflowAspectOfMethod(UnresolvedType declaringType)

perCflowHasAspectMethod

public static ResolvedMember perCflowHasAspectMethod(UnresolvedType declaringType)

perObjectAspectOfMethod

public static ResolvedMember perObjectAspectOfMethod(UnresolvedType declaringType)

perObjectHasAspectMethod

public static ResolvedMember perObjectHasAspectMethod(UnresolvedType declaringType)

perTypeWithinAspectOfMethod

public static ResolvedMember perTypeWithinAspectOfMethod(UnresolvedType declaringType,
                                                         boolean inJava5Mode)

perTypeWithinHasAspectMethod

public static ResolvedMember perTypeWithinHasAspectMethod(UnresolvedType declaringType,
                                                          boolean inJava5Mode)

privilegedAccessMethodForMethod

public static ResolvedMember privilegedAccessMethodForMethod(UnresolvedType aspectType,
                                                             ResolvedMember method)

privilegedAccessMethodForFieldGet

public static ResolvedMember privilegedAccessMethodForFieldGet(UnresolvedType aspectType,
                                                               Member field,
                                                               boolean shortSyntax)
Return a resolvedmember representing the synthetic getter for the field. The old style (<1.6.9) is a heavyweight static method with a long name. The new style (1.6.9 and later) is short, and reusable across aspects.

Parameters:
aspectType - the aspect attempting the access
field - the field to be accessed
shortSyntax - is the old (long) or new (short) style format being used
Returns:
a resolvedmember representing the synthetic getter

privilegedAccessMethodForFieldSet

public static ResolvedMember privilegedAccessMethodForFieldSet(UnresolvedType aspectType,
                                                               Member field,
                                                               boolean shortSyntax)
Return a resolvedmember representing the synthetic setter for the field. The old style (<1.6.9) is a heavyweight static method with a long name. The new style (1.6.9 and later) is short, not always static, and reusable across aspects.

Parameters:
aspectType - the aspect attempting the access
field - the field to be accessed
shortSyntax - is the old or new style format being used
Returns:
a resolvedmember representing the synthetic setter

superAccessMethod

public static ResolvedMember superAccessMethod(UnresolvedType baseType,
                                               ResolvedMember method)

inlineAccessMethodForMethod

public static ResolvedMember inlineAccessMethodForMethod(UnresolvedType aspectType,
                                                         ResolvedMember method)

inlineAccessMethodForFieldGet

public static ResolvedMember inlineAccessMethodForFieldGet(UnresolvedType aspectType,
                                                           Member field)

inlineAccessMethodForFieldSet

public static ResolvedMember inlineAccessMethodForFieldSet(UnresolvedType aspectType,
                                                           Member field)

cflowStackPeekInstance

public static Member cflowStackPeekInstance()

cflowStackPushInstance

public static Member cflowStackPushInstance()

cflowStackIsValid

public static Member cflowStackIsValid()

cflowStackInit

public static Member cflowStackInit()

aroundClosurePreInitializationField

public static Member aroundClosurePreInitializationField()

aroundClosurePreInitializationGetter

public static Member aroundClosurePreInitializationGetter()

preIntroducedConstructor

public static ResolvedMember preIntroducedConstructor(UnresolvedType aspectType,
                                                      UnresolvedType targetType,
                                                      UnresolvedType[] paramTypes)

postIntroducedConstructor

public static ResolvedMember postIntroducedConstructor(UnresolvedType aspectType,
                                                       UnresolvedType targetType,
                                                       UnresolvedType[] paramTypes)

itdAtDeclareParentsField

public static ResolvedMember itdAtDeclareParentsField(ResolvedType targetType,
                                                      UnresolvedType itdType,
                                                      UnresolvedType aspectType)

interConstructor

public static ResolvedMember interConstructor(ResolvedType targetType,
                                              ResolvedMember constructor,
                                              UnresolvedType aspectType)

interFieldInitializer

public static ResolvedMember interFieldInitializer(ResolvedMember field,
                                                   UnresolvedType aspectType)

interFieldSetDispatcher

public static ResolvedMember interFieldSetDispatcher(ResolvedMember field,
                                                     UnresolvedType aspectType)
This static method goes on the aspect that declares the inter-type field


interFieldGetDispatcher

public static ResolvedMember interFieldGetDispatcher(ResolvedMember field,
                                                     UnresolvedType aspectType)
This static method goes on the aspect that declares the inter-type field


interFieldClassField

public static ResolvedMember interFieldClassField(ResolvedMember field,
                                                  UnresolvedType aspectType,
                                                  boolean newStyle)
This field goes on the class the field is declared onto. Field names for ITDs onto interfaces are handled below.


interFieldInterfaceField

public static ResolvedMember interFieldInterfaceField(ResolvedMember field,
                                                      UnresolvedType onClass,
                                                      UnresolvedType aspectType,
                                                      boolean newStyle)
This field goes on top-most implementers of the interface the field is declared onto


interFieldInterfaceSetter

public static ResolvedMember interFieldInterfaceSetter(ResolvedMember field,
                                                       ResolvedType onType,
                                                       UnresolvedType aspectType)
This instance method goes on the interface the field is declared onto as well as its top-most implementors


interFieldInterfaceGetter

public static ResolvedMember interFieldInterfaceGetter(ResolvedMember field,
                                                       ResolvedType onType,
                                                       UnresolvedType aspectType)
This instance method goes on the interface the field is declared onto as well as its top-most implementors


interMethod

public static ResolvedMember interMethod(ResolvedMember meth,
                                         UnresolvedType aspectType,
                                         boolean onInterface)
This method goes on the target type of the inter-type method. (and possibly the topmost-implementors, if the target type is an interface). The implementation will call the interMethodDispatch method on the aspect.


interMethodBridger

public static ResolvedMember interMethodBridger(ResolvedMember meth,
                                                UnresolvedType aspectType,
                                                boolean onInterface)
This method goes on the target type of the inter-type method. (and possibly the topmost-implementors, if the target type is an interface). The implementation will call the interMethodDispatch method on the aspect.


bridgerToInterMethod

public static ResolvedMember bridgerToInterMethod(ResolvedMember meth,
                                                  UnresolvedType aspectType)
Sometimes the intertyped method requires a bridge method alongside it. For example if the method 'N SomeI.m()' is put onto an interface 'interface I' and then a concrete implementation is 'class C implements I' then the ITD on the interface will be 'Number m()', whereas the ITD on the 'topmostimplementor' will be 'Float m()'. A bridge method needs to be created in the topmostimplementor 'Number m()' that delegates to 'Float m()'


interMethodDispatcher

public static ResolvedMember interMethodDispatcher(ResolvedMember meth,
                                                   UnresolvedType aspectType)
This static method goes on the declaring aspect of the inter-type method. The implementation calls the interMethodBody() method on the aspect.


interMethodBody

public static ResolvedMember interMethodBody(ResolvedMember meth,
                                             UnresolvedType aspectType)
This method goes on the declaring aspect of the inter-type method. It contains the real body of the ITD method.


toObjectConversionMethod

public static ResolvedMember toObjectConversionMethod(UnresolvedType fromType)

interfaceConstructor

public static Member interfaceConstructor(ResolvedType resolvedTypeX)