Top Fields Constructors Methods
org.aspectj.weaver

public Class MemberImpl

extends Object
implements Member
Class Inheritance
All Implemented Interfaces
org.aspectj.weaver.Member, java.lang.Comparable
Known Direct Subclasses
org.aspectj.weaver.ResolvedMemberImpl
Imports
java.lang.reflect.Modifier, java.util.ArrayList, .Collection, .HashSet, .Iterator, .List

Field Summary

Modifier and TypeField and Description
protected UnresolvedType
private final String
private volatile int
hashCode

Equality is checked based on the underlying signature, so the hash code of a member is based on its kind, name, signature, and declaring type.

private JoinPointSignatureIterator
joinPointSignatures

All the signatures that a join point with this member as its signature has.

protected MemberKind
protected int
protected String
protected UnresolvedType[]
private String
private boolean
private boolean
protected UnresolvedType

Constructor Summary

AccessConstructor and Description
public
MemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, String name, String erasedSignature)

Construct a MemberImpl using an erased signature for the parameters and return type (member method/ctor) or type (member field)

public
MemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, UnresolvedType returnType, String name, UnresolvedType[] parameterTypes)

Construct a MemberImpl using real type information for the parameters and return type (member method/ctor) or type (member field)

Method Summary

Modifier and TypeMethod and Description
public boolean
canBeParameterized()

Implements org.aspectj.weaver.Member.canBeParameterized.

Returns true iff the member is generic (NOT parameterized)
public int
compareTo(Member
the object to be compared.
other
)

Implements org.aspectj.weaver.Member.compareTo.

Compares this object with the specified object for order.
public final boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public final boolean

Returns:

true if this member equals the one supplied in every respect other than the declaring type
equalsApartFromDeclaringType
(Object other)

public static MemberImpl
field(String declaring, int mods, String name, String signature)

private static MemberImpl
field(String declaring, int mods, UnresolvedType ty, String name)

public AnnotationAJ[]
public int
public UnresolvedType
public Collection<ResolvedType>
public UnresolvedType[]
public UnresolvedType[]
public UnresolvedType
public JoinPointSignatureIterator
getJoinPointSignatures(World inAWorld)

Implements org.aspectj.weaver.Member.getJoinPointSignatures.

All the signatures that a join point with this member as its signature has.
public MemberKind
public int
public int
public String
public String[]
public String
getParameterSignature()

Implements org.aspectj.weaver.Member.getParameterSignature.

Return signature without return type, e.g. "()" for a signature *with* the return type, use getSignature() - it is important to choose the right one in the face of covariance.
public UnresolvedType[]
public UnresolvedType
public String
getSignature()

Implements org.aspectj.weaver.Member.getSignature.

Return full signature, including return type, e.g. "()LFastCar;".
public final UnresolvedType
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public final boolean
public final boolean
public final boolean
public static ResolvedMemberImpl
public static MemberImpl
method(UnresolvedType declaring, int mods, String name, String signature)

public static MemberImpl
method(UnresolvedType declTy, int mods, UnresolvedType rTy, String name, UnresolvedType[] paramTys)

public static MemberImpl
public static MemberImpl
public static Member
pointcut(UnresolvedType declaring, String name, String signature)

private static Member
pointcut(UnresolvedType declTy, int mods, UnresolvedType rTy, String name, UnresolvedType[] paramTys)

private void
reportDidntFindMember(World world)

Raises an [Xlint:cantFindType] message if the declaring type cannot be found or an [Xlint:unresolvableMember] message if the type can be found (bug 149908)

public ResolvedMember
private static Object[]

Returns:

a pair of UnresolvedType, UnresolvedType[] representing the return types and parameter types.
signatureToTypes
(String
the JVM bytecode method signature string we want to break apart
sig
)

returns an Object[] pair of UnresolvedType, UnresolvedType[] representing return type, argument types parsed from the JVM bytecode signature of a method.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public static String
typesToSignature(UnresolvedType returnType, UnresolvedType[] paramTypes, boolean eraseGenerics)

Build a signature based on the return type and parameter types.

public static String
typesToSignature(UnresolvedType[] paramTypes)

Returns "(<signaturesOfParamTypes>,...)" - unlike the other typesToSignature that also includes the return type, this one just deals with the parameter types.

private boolean
private boolean
public void
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

declaringTypeback to summary
protected UnresolvedType declaringType
erasedSignatureback to summary
private final String erasedSignature
hashCodeback to summary
private volatile int hashCode

Equality is checked based on the underlying signature, so the hash code of a member is based on its kind, name, signature, and declaring type. The algorithm for this was taken from page 38 of effective java.

joinPointSignaturesback to summary
private JoinPointSignatureIterator joinPointSignatures

All the signatures that a join point with this member as its signature has.

kindback to summary
protected MemberKind kind
modifiersback to summary
protected int modifiers
nameback to summary
protected String name
parameterTypesback to summary
protected UnresolvedType[] parameterTypes
paramSignatureback to summary
private String paramSignature
reportedCantFindDeclaringTypeback to summary
private boolean reportedCantFindDeclaringType
reportedUnresolvableMemberback to summary
private boolean reportedUnresolvableMember
returnTypeback to summary
protected UnresolvedType returnType

Constructor Detail

MemberImplback to summary
public MemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, String name, String erasedSignature)

Construct a MemberImpl using an erased signature for the parameters and return type (member method/ctor) or type (member field)

MemberImplback to summary
public MemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, UnresolvedType returnType, String name, UnresolvedType[] parameterTypes)

Construct a MemberImpl using real type information for the parameters and return type (member method/ctor) or type (member field)

Method Detail

canBeParameterizedback to summary
public boolean canBeParameterized()

Implements org.aspectj.weaver.Member.canBeParameterized.

Doc from org.aspectj.weaver.Member.canBeParameterized.

Returns true iff the member is generic (NOT parameterized)

compareToback to summary
public int compareTo(Member other)

Implements org.aspectj.weaver.Member.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
other:Member

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

equalsback to summary
public final boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
equalsApartFromDeclaringTypeback to summary
public final boolean equalsApartFromDeclaringType(Object other)
Returns:boolean

true if this member equals the one supplied in every respect other than the declaring type

fieldback to summary
public static MemberImpl field(String declaring, int mods, String name, String signature)
fieldback to summary
private static MemberImpl field(String declaring, int mods, UnresolvedType ty, String name)
getAnnotationsback to summary
public AnnotationAJ[] getAnnotations()

Implements org.aspectj.weaver.Member.getAnnotations.

getArityback to summary
public int getArity()

Implements org.aspectj.weaver.Member.getArity.

getDeclaringTypeback to summary
public UnresolvedType getDeclaringType()

Implements org.aspectj.weaver.Member.getDeclaringType.

getDeclaringTypesback to summary
public Collection<ResolvedType> getDeclaringTypes(World world)

Implements org.aspectj.weaver.Member.getDeclaringTypes.

getExceptionsback to summary
public UnresolvedType[] getExceptions(World world)

Implements org.aspectj.weaver.Member.getExceptions.

getGenericParameterTypesback to summary
public UnresolvedType[] getGenericParameterTypes()

Implements org.aspectj.weaver.Member.getGenericParameterTypes.

getGenericReturnTypeback to summary
public UnresolvedType getGenericReturnType()

Implements org.aspectj.weaver.Member.getGenericReturnType.

getJoinPointSignaturesback to summary
public JoinPointSignatureIterator getJoinPointSignatures(World inAWorld)

Implements org.aspectj.weaver.Member.getJoinPointSignatures.

All the signatures that a join point with this member as its signature has.

getKindback to summary
public MemberKind getKind()

Implements org.aspectj.weaver.Member.getKind.

Returns:MemberKind

Doc from org.aspectj.weaver.Member.getKind.

the kind of member from those listed as MemberKind instances

getModifiersback to summary
public int getModifiers(World world)

Implements org.aspectj.weaver.Member.getModifiers.

getModifiersback to summary
public int getModifiers()

Implements org.aspectj.weaver.Member.getModifiers.

getNameback to summary
public String getName()

Implements org.aspectj.weaver.Member.getName.

getParameterNamesback to summary
public String[] getParameterNames(World world)

Implements org.aspectj.weaver.Member.getParameterNames.

getParameterSignatureback to summary
public String getParameterSignature()

Implements org.aspectj.weaver.Member.getParameterSignature.

Doc from org.aspectj.weaver.Member.getParameterSignature.

Return signature without return type, e.g. "()" for a signature *with* the return type, use getSignature() - it is important to choose the right one in the face of covariance.

getParameterTypesback to summary
public UnresolvedType[] getParameterTypes()

Implements org.aspectj.weaver.Member.getParameterTypes.

getReturnTypeback to summary
public UnresolvedType getReturnType()

Implements org.aspectj.weaver.Member.getReturnType.

getSignatureback to summary
public String getSignature()

Implements org.aspectj.weaver.Member.getSignature.

Doc from org.aspectj.weaver.Member.getSignature.

Return full signature, including return type, e.g. "()LFastCar;". For a signature without the return type, use getParameterSignature() - it is important to choose the right one in the face of covariance.

getTypeback to summary
public final UnresolvedType getType()

Implements org.aspectj.weaver.Member.getType.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isInterfaceback to summary
public final boolean isInterface()
isPrivateback to summary
public final boolean isPrivate()
isStaticback to summary
public final boolean isStatic()
makeExceptionHandlerSignatureback to summary
public static ResolvedMemberImpl makeExceptionHandlerSignature(UnresolvedType inType, UnresolvedType catchType)
methodback to summary
public static MemberImpl method(UnresolvedType declaring, int mods, String name, String signature)
methodback to summary
public static MemberImpl method(UnresolvedType declTy, int mods, UnresolvedType rTy, String name, UnresolvedType[] paramTys)
monitorEnterback to summary
public static MemberImpl monitorEnter()
monitorExitback to summary
public static MemberImpl monitorExit()
pointcutback to summary
public static Member pointcut(UnresolvedType declaring, String name, String signature)
pointcutback to summary
private static Member pointcut(UnresolvedType declTy, int mods, UnresolvedType rTy, String name, UnresolvedType[] paramTys)
reportDidntFindMemberback to summary
private void reportDidntFindMember(World world)

Raises an [Xlint:cantFindType] message if the declaring type cannot be found or an [Xlint:unresolvableMember] message if the type can be found (bug 149908)

resolveback to summary
public ResolvedMember resolve(World world)

Implements org.aspectj.weaver.Member.resolve.

signatureToTypesback to summary
private static Object[] signatureToTypes(String sig)

returns an Object[] pair of UnresolvedType, UnresolvedType[] representing return type, argument types parsed from the JVM bytecode signature of a method. Yes, this should actually return a nice statically-typed pair object, but we don't have one of those.

  UnresolvedType.signatureToTypes("()[Z")[0].equals(Type.forSignature("[Z"))
  UnresolvedType.signatureToTypes("(JJ)I")[1]
     .equals(UnresolvedType.forSignatures(new String[] {"J", "J"}))
Parameters
sig:String

the JVM bytecode method signature string we want to break apart

Returns:Object[]

a pair of UnresolvedType, UnresolvedType[] representing the return types and parameter types.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
typesToSignatureback to summary
public static String typesToSignature(UnresolvedType returnType, UnresolvedType[] paramTypes, boolean eraseGenerics)

Build a signature based on the return type and parameter types. For example: "(Ljava/util/Set<Ljava/lang/String;>;)V" or "(Ljava/util/Set;)V". The latter form shows what happens when the generics are erased

typesToSignatureback to summary
public static String typesToSignature(UnresolvedType[] paramTypes)

Returns "(<signaturesOfParamTypes>,...)" - unlike the other typesToSignature that also includes the return type, this one just deals with the parameter types.

walkUpback to summary
private boolean walkUp(Collection<ResolvedType> acc, ResolvedType curr)
walkUpStaticback to summary
private boolean walkUpStatic(Collection<ResolvedType> acc, ResolvedType curr)
wipeJoinpointSignaturesback to summary
public void wipeJoinpointSignatures()