org.aspectj.weaver
Class MethodDelegateTypeMunger

java.lang.Object
  extended by org.aspectj.weaver.ResolvedTypeMunger
      extended by org.aspectj.weaver.MethodDelegateTypeMunger

public class MethodDelegateTypeMunger
extends ResolvedTypeMunger

Type munger for annotation style ITD declare parents. with an interface AND an implementation. Given the aspect that has a field public static Interface fieldI = ... // impl. we will weave in the Interface' methods and delegate to the aspect public static field fieldI Note: this munger DOES NOT handles the interface addition to the target classes - a regular Parent kinded munger must be added in coordination.


Nested Class Summary
static class MethodDelegateTypeMunger.FieldHostTypeMunger
           
 
Nested classes/interfaces inherited from class org.aspectj.weaver.ResolvedTypeMunger
ResolvedTypeMunger.Kind
 
Field Summary
 
Fields inherited from class org.aspectj.weaver.ResolvedTypeMunger
AnnotationOnType, Constructor, declaredSignature, Field, FieldHost, InnerClass, kind, Method, MethodDelegate, MethodDelegate2, Parent, PerObjectInterface, PerTypeWithinInterface, PrivilegedAccess, signature, SUPER_DISPATCH_NAME, typeVariableAliases
 
Constructor Summary
MethodDelegateTypeMunger(ResolvedMember signature, UnresolvedType aspect, java.lang.String implClassName, TypePattern typePattern)
          Construct a new type munger for @AspectJ ITD
MethodDelegateTypeMunger(ResolvedMember signature, UnresolvedType aspect, java.lang.String implClassName, TypePattern typePattern, java.lang.String factoryMethodName, java.lang.String factoryMethodSignature)
           
 
Method Summary
 boolean changesPublicSignature()
          Needed for reweavable
 boolean equals(java.lang.Object other)
           
 boolean existsToSupportShadowMunging()
          Some type mungers are created purely to help with the implementation of shadow mungers.
 UnresolvedType getAspect()
           
 ResolvedMember getDelegate(ResolvedType targetType)
           
 ResolvedMember getDelegateFactoryMethod(World w)
           
 java.lang.String getFactoryMethodName()
           
 java.lang.String getFactoryMethodSignature()
           
 java.lang.String getImplClassName()
           
 int hashCode()
           
 boolean isReplacingExistingMethod()
           
 boolean matches(ResolvedType matchType, ResolvedType aspectType)
          Match based on given type pattern, only classes can be matched
static ResolvedTypeMunger readMethod(VersionedDataInputStream s, ISourceContext context, boolean isEnhanced)
           
 void setFieldType(UnresolvedType fieldType)
           
 boolean specifiesDelegateFactoryMethod()
           
 void tagAsReplacingExistingMethod()
           
 void write(CompressingDataOutputStream s)
           
 
Methods inherited from class org.aspectj.weaver.ResolvedTypeMunger
getDeclaredSignature, getDeclaringType, getKind, getMatchingSyntheticMember, getSignature, getSourceLocation, getSuperMethodsCalled, getTypeVariableAliases, hasTypeVariableAliases, isLateMunger, needsAccessToTopmostImplementor, parameterizedFor, parameterizeWith, read, readInTypeAliases, readSourceLocation, readSuperMethodsCalled, setDeclaredSignature, setSourceLocation, setSuperMethodsCalled, setTypeVariableAliases, sharesTypeVariablesWithGenericType, toString, writeOutTypeAliases, writeSourceLocation, writeSuperMethodsCalled
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MethodDelegateTypeMunger

public MethodDelegateTypeMunger(ResolvedMember signature,
                                UnresolvedType aspect,
                                java.lang.String implClassName,
                                TypePattern typePattern)
Construct a new type munger for @AspectJ ITD

Parameters:
signature -
aspect -
implClassName -
typePattern -

MethodDelegateTypeMunger

public MethodDelegateTypeMunger(ResolvedMember signature,
                                UnresolvedType aspect,
                                java.lang.String implClassName,
                                TypePattern typePattern,
                                java.lang.String factoryMethodName,
                                java.lang.String factoryMethodSignature)
Method Detail

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getDelegate

public ResolvedMember getDelegate(ResolvedType targetType)

getDelegateFactoryMethod

public ResolvedMember getDelegateFactoryMethod(World w)

getImplClassName

public java.lang.String getImplClassName()

write

public void write(CompressingDataOutputStream s)
           throws java.io.IOException
Specified by:
write in class ResolvedTypeMunger
Throws:
java.io.IOException

readMethod

public static ResolvedTypeMunger readMethod(VersionedDataInputStream s,
                                            ISourceContext context,
                                            boolean isEnhanced)
                                     throws java.io.IOException
Throws:
java.io.IOException

matches

public boolean matches(ResolvedType matchType,
                       ResolvedType aspectType)
Match based on given type pattern, only classes can be matched

Overrides:
matches in class ResolvedTypeMunger
Parameters:
matchType -
aspectType -
Returns:
true if match

changesPublicSignature

public boolean changesPublicSignature()
Needed for reweavable

Overrides:
changesPublicSignature in class ResolvedTypeMunger
Returns:
true

setFieldType

public void setFieldType(UnresolvedType fieldType)

specifiesDelegateFactoryMethod

public boolean specifiesDelegateFactoryMethod()

getFactoryMethodName

public java.lang.String getFactoryMethodName()

getFactoryMethodSignature

public java.lang.String getFactoryMethodSignature()

getAspect

public UnresolvedType getAspect()

existsToSupportShadowMunging

public boolean existsToSupportShadowMunging()
Description copied from class: ResolvedTypeMunger
Some type mungers are created purely to help with the implementation of shadow mungers. For example to support the cflow() pointcut we create a new cflow field in the aspect, and that is added via a BcelCflowCounterFieldAdder. During compilation we need to compare sets of type mungers, and if some only come into existence after the 'shadowy' type things have been processed, we need to ignore them during the comparison. Returning true from this method indicates the type munger exists to support 'shadowy' stuff - and so can be ignored in some comparison.

Overrides:
existsToSupportShadowMunging in class ResolvedTypeMunger

tagAsReplacingExistingMethod

public void tagAsReplacingExistingMethod()

isReplacingExistingMethod

public boolean isReplacingExistingMethod()