Class ReflectionBasedResolvedMemberImpl
java.lang.Object
org.aspectj.weaver.MemberImpl
org.aspectj.weaver.ResolvedMemberImpl
org.aspectj.weaver.reflect.ReflectionBasedResolvedMemberImpl
- All Implemented Interfaces:
Comparable<Member>, AnnotatedElement, IHasPosition, Member, ResolvedMember, TypeVariableDeclaringElement
Subtype of ResolvedMemberImpl used in reflection world. Knows how to get annotations from a java.lang.reflect.Member
- Author:
- Adrian Colyer, Andy Clement
-
Field Summary
Fields inherited from class ResolvedMemberImpl
annotations, annotationTypes, backingGenericMember, checkedExceptions, end, parameterAnnotations, parameterAnnotationTypes, showParameterNames, sourceContext, start, typeVariablesModifier and TypeFieldDescriptionprotected AnnotationAJ[]protected ResolvedType[]protected ResolvedMemberif this member is a parameterized version of a member in a generic type, then this field holds a reference to the member we parameterize.protected UnresolvedType[]protected intprotected AnnotationAJ[][]protected ResolvedType[][]static booleanprotected ISourceContextprotected intprotected TypeVariable[]Fields inherited from class MemberImpl
declaringType, kind, modifiers, name, parameterTypes, returnTypeModifier and TypeFieldDescriptionprotected UnresolvedTypeprotected MemberKindprotected intprotected Stringprotected UnresolvedType[]protected UnresolvedTypeFields inherited from interface Member
ADVICE, CONSTRUCTOR, FIELD, HANDLER, METHOD, MONITORENTER, MONITOREXIT, NO_PARAMETER_ANNOTATION_TYPES, NO_PARAMETER_ANNOTATIONXS, NONE, POINTCUT, STATIC_INITIALIZATIONModifier and TypeFieldDescriptionstatic final MemberKindstatic final MemberKindstatic final MemberKindstatic final MemberKindstatic final MemberKindstatic final MemberKindstatic final MemberKindstatic final ResolvedType[][]static final AnnotationAJ[][]static final Member[]static final MemberKindstatic final MemberKindFields inherited from interface ResolvedMember
NONE -
Constructor Summary
ConstructorsConstructorDescriptionReflectionBasedResolvedMemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, String name, String signature, Member reflectMember) ReflectionBasedResolvedMemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, UnresolvedType returnType, String name, UnresolvedType[] parameterTypes, Member reflectMember) ReflectionBasedResolvedMemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, UnresolvedType returnType, String name, UnresolvedType[] parameterTypes, UnresolvedType[] checkedExceptions, Member reflectMember) ReflectionBasedResolvedMemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, UnresolvedType returnType, String name, UnresolvedType[] parameterTypes, UnresolvedType[] checkedExceptions, ResolvedMember backingGenericMember, Member reflectMember) -
Method Summary
Modifier and TypeMethodDescriptiongetAnnotationOfType(UnresolvedType ofType) Get the TypeXs of the parameter types, taking generic signature into accountGet the UnresolvedType for the return type, taking generic signature into accountResolvedType[][]booleanhasAnnotation(UnresolvedType ofType) Check if this member has an annotation of the specified type.booleanbooleanbooleanbooleanvoidsetAnnotationFinder(AnnotationFinder finder) voidMethods inherited from class ResolvedMemberImpl
addAnnotation, appendSigWithTypeVarBoundsRemoved, evictWeavingState, getAnnotations, getAssociatedShadowMunger, getBackingGenericMember, getEffectiveSignature, getEnd, getExceptions, getExceptions, getGenericSignature, getJoinPointSignatures, getModifiers, getModifiers, getParameterAnnotations, getParameterNames, getParameterNames, getParameterSignatureErased, getSignatureErased, getSignatureForAttribute, getSourceContext, getSourceContext, getSourceLocation, getStart, getTypeVariableNamed, getTypeVariables, hasBackingGenericMember, isAbstract, isAjSynthetic, isAnnotatedElsewhere, isCompatibleWith, isDefault, isDefaultConstructor, isEquivalentTo, isPublic, isVisible, matches, parameterize, parameterizedWith, parameterizedWith, parameterizedWith, readResolvedMember, readResolvedMemberArray, resetKind, resetModifiers, resetName, resetReturnTypeToObjectArray, resolve, setAjSynthetic, setAnnotatedElsewhere, setAnnotations, setAnnotationTypes, setCheckedExceptions, setDeclaringType, setParameterNames, setPosition, setSourceContext, setTypeVariables, setVarargsMethod, toDebugString, toGenericString, write, writeArrayModifier and TypeMethodDescriptionvoidaddAnnotation(AnnotationAJ annotation) static voidappendSigWithTypeVarBoundsRemoved(UnresolvedType aType, StringBuffer toBuffer, Set<UnresolvedType> alreadyUsedTypeVars) voidintgetEnd()The ending index of this location in the character stream This points to the last character in this token.final UnresolvedType[]getExceptions(World world) static JoinPointSignature[]getJoinPointSignatures(Member joinPointSignature, World inAWorld) Compute the full set of signatures for a member.final intfinal intgetModifiers(World world) AnnotationAJ[][]String[]final String[]getParameterNames(World world) Return the erased form of the signature with bounds collapsed for type variables, etc.Return the member generic signature that would be suitable for inclusion in a class file Signature attribute.getSourceContext(World world) intgetStart()The starting index of this location in the character stream.getTypeVariableNamed(String name) booleanIf this member is defined by a parameterized super-type, return the erasure of that member.booleanbooleanbooleanbooleanbooleanbooleanbooleanisEquivalentTo(Object other) booleanisPublic()booleanisVisible(ResolvedType fromType) booleanmatches(ResolvedMember aCandidateMatch, boolean ignoreGenerics) Returns true if this member matches the other.protected UnresolvedTypeparameterize(UnresolvedType aType, Map<String, UnresolvedType> typeVariableMap, boolean inParameterizedType, World w) parameterizedWith(Map<String, UnresolvedType> m, World w) Replace occurrences of type variables in the signature with values contained in the map.parameterizedWith(UnresolvedType[] typeParameters, ResolvedType newDeclaringType, boolean isParameterized) parameterizedWith(UnresolvedType[] typeParameters, ResolvedType newDeclaringType, boolean isParameterized, List<String> aliases) Return a resolvedmember in which all the type variables in the signature have been replaced with the given bindings.static ResolvedMemberImplreadResolvedMember(VersionedDataInputStream s, ISourceContext sourceContext) static ResolvedMember[]voidresetKind(MemberKind newKind) voidresetModifiers(int newModifiers) voidFor ITDs, we use the default factory methods to build a resolved member, then alter a couple of characteristics using this method - this is safe.voidprotected voidsetAjSynthetic(boolean b) voidsetAnnotatedElsewhere(boolean b) voidsetAnnotations(AnnotationAJ[] annotations) voidsetAnnotationTypes(ResolvedType[] annotationTypes) voidsetCheckedExceptions(UnresolvedType[] checkedExceptions) voidfinal voidsetParameterNames(String[] pnames) voidsetPosition(int sourceStart, int sourceEnd) voidsetSourceContext(ISourceContext sourceContext) voidsetTypeVariables(TypeVariable[] tvars) voidUseful for writing tests, returns *everything* we know about this member.voidstatic voidwriteArray(ResolvedMember[] members, CompressingDataOutputStream s) Methods inherited from class MemberImpl
canBeParameterized, compareTo, equals, equalsApartFromDeclaringType, field, getArity, getDeclaringType, getDeclaringTypes, getJoinPointSignatures, getKind, getName, getParameterSignature, getParameterTypes, getReturnType, getSignature, getType, hashCode, isInterface, isPrivate, isStatic, makeExceptionHandlerSignature, method, method, monitorEnter, monitorExit, pointcut, toString, typesToSignature, typesToSignature, wipeJoinpointSignaturesModifier and TypeMethodDescriptionbooleanReturns true iff the member is generic (NOT parameterized)intfinal booleanfinal booleanstatic MemberImplintgetArity()getDeclaringTypes(World world) getJoinPointSignatures(World inAWorld) All the signatures that a join point with this member as its signature has.getKind()getName()Return signature without return type, e.g.Return full signature, including return type, e.g.final UnresolvedTypegetType()inthashCode()final booleanfinal booleanfinal booleanisStatic()static ResolvedMemberImplmakeExceptionHandlerSignature(UnresolvedType inType, UnresolvedType catchType) static MemberImplmethod(UnresolvedType declaring, int mods, String name, String signature) static MemberImplmethod(UnresolvedType declTy, int mods, UnresolvedType rTy, String name, UnresolvedType[] paramTys) static MemberImplstatic MemberImplstatic Memberpointcut(UnresolvedType declaring, String name, String signature) toString()static StringtypesToSignature(UnresolvedType[] paramTypes) Returns "(<signaturesOfParamTypes>,...)" - unlike the other typesToSignature that also includes the return type, this one just deals with the parameter types.static StringtypesToSignature(UnresolvedType returnType, UnresolvedType[] paramTypes, boolean eraseGenerics) Build a signature based on the return type and parameter types.voidMethods inherited from interface ResolvedMember
equalsApartFromDeclaringType
-
Constructor Details
-
ReflectionBasedResolvedMemberImpl
public ReflectionBasedResolvedMemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, UnresolvedType returnType, String name, UnresolvedType[] parameterTypes, Member reflectMember) -
ReflectionBasedResolvedMemberImpl
public ReflectionBasedResolvedMemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, UnresolvedType returnType, String name, UnresolvedType[] parameterTypes, UnresolvedType[] checkedExceptions, Member reflectMember) -
ReflectionBasedResolvedMemberImpl
public ReflectionBasedResolvedMemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, UnresolvedType returnType, String name, UnresolvedType[] parameterTypes, UnresolvedType[] checkedExceptions, ResolvedMember backingGenericMember, Member reflectMember) -
ReflectionBasedResolvedMemberImpl
public ReflectionBasedResolvedMemberImpl(MemberKind kind, UnresolvedType declaringType, int modifiers, String name, String signature, Member reflectMember)
-
-
Method Details
-
getMember
-
setGenericSignatureInformationProvider
public void setGenericSignatureInformationProvider(GenericSignatureInformationProvider gsigProvider) -
getGenericParameterTypes
Description copied from class:ResolvedMemberImplGet the TypeXs of the parameter types, taking generic signature into account- Specified by:
getGenericParameterTypesin interfaceMember- Specified by:
getGenericParameterTypesin interfaceResolvedMember- Overrides:
getGenericParameterTypesin classResolvedMemberImpl
-
getGenericReturnType
Description copied from class:ResolvedMemberImplGet the UnresolvedType for the return type, taking generic signature into account- Specified by:
getGenericReturnTypein interfaceMember- Specified by:
getGenericReturnTypein interfaceResolvedMember- Overrides:
getGenericReturnTypein classResolvedMemberImpl
-
isSynthetic
public boolean isSynthetic()- Specified by:
isSyntheticin interfaceResolvedMember- Overrides:
isSyntheticin classResolvedMemberImpl
-
isVarargsMethod
public boolean isVarargsMethod()- Specified by:
isVarargsMethodin interfaceResolvedMember- Overrides:
isVarargsMethodin classResolvedMemberImpl
-
isBridgeMethod
public boolean isBridgeMethod()- Specified by:
isBridgeMethodin interfaceResolvedMember- Overrides:
isBridgeMethodin classResolvedMemberImpl
-
setAnnotationFinder
-
hasAnnotation
Description copied from class:ResolvedMemberImplCheck if this member has an annotation of the specified type. If the member has a backing generic member then this member represents a parameterization of a member in a generic type and the annotations available on the backing generic member should be used.- Specified by:
hasAnnotationin interfaceAnnotatedElement- Specified by:
hasAnnotationin interfaceResolvedMember- Overrides:
hasAnnotationin classResolvedMemberImpl- Parameters:
ofType- the type of the annotation being searched for- Returns:
- true if the annotation is found on this member or its backing generic member
-
hasAnnotations
public boolean hasAnnotations()- Overrides:
hasAnnotationsin classResolvedMemberImpl
-
getAnnotationTypes
- Specified by:
getAnnotationTypesin interfaceAnnotatedElement- Specified by:
getAnnotationTypesin interfaceResolvedMember- Overrides:
getAnnotationTypesin classResolvedMemberImpl
-
getAnnotationOfType
- Specified by:
getAnnotationOfTypein interfaceAnnotatedElement- Overrides:
getAnnotationOfTypein classResolvedMemberImpl
-
getAnnotationDefaultValue
- Specified by:
getAnnotationDefaultValuein interfaceResolvedMember- Overrides:
getAnnotationDefaultValuein classResolvedMemberImpl
-
getParameterAnnotationTypes
- Specified by:
getParameterAnnotationTypesin interfaceResolvedMember- Overrides:
getParameterAnnotationTypesin classResolvedMemberImpl
-