Package javassist
Class CtMember.Cache
- java.lang.Object
-
- javassist.CtMember
-
- javassist.CtMember.Cache
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javassist.CtMember
CtMember.Cache
-
-
Field Summary
Fields Modifier and Type Field Description private CtMemberconsTailprivate CtMemberfieldTailprivate CtMembermethodTail-
Fields inherited from class javassist.CtMember
declaringClass, next
-
-
Constructor Summary
Constructors Constructor Description Cache(CtClassType decl)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddConstructor(CtMember cons)(package private) voidaddField(CtMember field)(package private) voidaddMethod(CtMember method)(package private) CtMemberconsHead()(package private) static intcount(CtMember head, CtMember tail)protected voidextendToString(java.lang.StringBuffer buffer)Invoked byCtMember.toString()to add to the buffer and provide the complete value.(package private) CtMemberfieldHead()java.lang.ObjectgetAnnotation(java.lang.Class<?> clz)Returns the annotation if the class has the specified annotation type.java.lang.Object[]getAnnotations()Returns the annotations associated with this member.byte[]getAttribute(java.lang.String name)Obtains a user-defined attribute with the given name.java.lang.Object[]getAvailableAnnotations()Returns the annotations associated with this member.java.lang.StringgetGenericSignature()Returns the generic signature of the member.intgetModifiers()Obtains the modifiers of the member.java.lang.StringgetName()Obtains the name of the member.java.lang.StringgetSignature()Returns the character string representing the signature of the member.booleanhasAnnotation(java.lang.String clz)Returns true if the class has the specified annotation type.(package private) CtMemberlastCons()(package private) CtMemberlastField()(package private) CtMemberlastMethod()(package private) CtMembermethodHead()(package private) voidremove(CtMember mem)voidsetAttribute(java.lang.String name, byte[] data)Adds a user-defined attribute.voidsetGenericSignature(java.lang.String sig)Sets the generic signature of the member.voidsetModifiers(int mod)Sets the encoded modifiers of the member.-
Methods inherited from class javassist.CtMember
getDeclaringClass, hasAnnotation, nameReplaced, next, toString, visibleFrom
-
-
-
-
Constructor Detail
-
Cache
Cache(CtClassType decl)
-
-
Method Detail
-
extendToString
protected void extendToString(java.lang.StringBuffer buffer)
Description copied from class:CtMemberInvoked byCtMember.toString()to add to the buffer and provide the complete value. Subclasses should invoke this method, adding a space before each token. The modifiers for the member are provided first; subclasses should provide additional data such as return type, field or method name, etc.- Specified by:
extendToStringin classCtMember
-
hasAnnotation
public boolean hasAnnotation(java.lang.String clz)
Description copied from class:CtMemberReturns true if the class has the specified annotation type.- Specified by:
hasAnnotationin classCtMember- Parameters:
clz- the name of annotation type.- Returns:
trueif the annotation is found, otherwisefalse.
-
getAnnotation
public java.lang.Object getAnnotation(java.lang.Class<?> clz) throws java.lang.ClassNotFoundExceptionDescription copied from class:CtMemberReturns the annotation if the class has the specified annotation type. For example, if an annotation@Authoris associated with this member, anAuthorobject is returned. The member values can be obtained by calling methods on theAuthorobject.- Specified by:
getAnnotationin classCtMember- Parameters:
clz- the annotation type.- Returns:
- the annotation if found, otherwise
null. - Throws:
java.lang.ClassNotFoundException
-
getAnnotations
public java.lang.Object[] getAnnotations() throws java.lang.ClassNotFoundExceptionDescription copied from class:CtMemberReturns the annotations associated with this member. For example, if an annotation@Authoris associated with this member, the returned array contains anAuthorobject. The member values can be obtained by calling methods on theAuthorobject.- Specified by:
getAnnotationsin classCtMember- Returns:
- an array of annotation-type objects.
- Throws:
java.lang.ClassNotFoundException- See Also:
CtClass.getAnnotations()
-
getAttribute
public byte[] getAttribute(java.lang.String name)
Description copied from class:CtMemberObtains a user-defined attribute with the given name. If that attribute is not found in the class file, this method returns null.Note that an attribute is a data block specified by the class file format. See
AttributeInfo.- Specified by:
getAttributein classCtMember- Parameters:
name- attribute name
-
getAvailableAnnotations
public java.lang.Object[] getAvailableAnnotations()
Description copied from class:CtMemberReturns the annotations associated with this member. This method is equivalent togetAnnotations()except that, if any annotations are not on the classpath, they are not included in the returned array.- Specified by:
getAvailableAnnotationsin classCtMember- Returns:
- an array of annotation-type objects.
- See Also:
CtMember.getAnnotations(),CtClass.getAvailableAnnotations()
-
getModifiers
public int getModifiers()
Description copied from class:CtMemberObtains the modifiers of the member.- Specified by:
getModifiersin classCtMember- Returns:
- modifiers encoded with
javassist.Modifier. - See Also:
Modifier
-
getName
public java.lang.String getName()
Description copied from class:CtMemberObtains the name of the member.As for constructor names, see
getName()inCtConstructor.- Specified by:
getNamein classCtMember- See Also:
CtConstructor.getName()
-
getSignature
public java.lang.String getSignature()
Description copied from class:CtMemberReturns the character string representing the signature of the member. If two members have the same signature (parameter types etc.),getSignature()returns the same string.- Specified by:
getSignaturein classCtMember
-
setAttribute
public void setAttribute(java.lang.String name, byte[] data)Description copied from class:CtMemberAdds a user-defined attribute. The attribute is saved in the class file.Note that an attribute is a data block specified by the class file format. See
AttributeInfo.- Specified by:
setAttributein classCtMember- Parameters:
name- attribute namedata- attribute value
-
setModifiers
public void setModifiers(int mod)
Description copied from class:CtMemberSets the encoded modifiers of the member.- Specified by:
setModifiersin classCtMember- See Also:
Modifier
-
getGenericSignature
public java.lang.String getGenericSignature()
Description copied from class:CtMemberReturns the generic signature of the member.- Specified by:
getGenericSignaturein classCtMember- See Also:
SignatureAttribute.toFieldSignature(String),SignatureAttribute.toMethodSignature(String),CtClass.getGenericSignature()
-
setGenericSignature
public void setGenericSignature(java.lang.String sig)
Description copied from class:CtMemberSets the generic signature of the member.- Specified by:
setGenericSignaturein classCtMember- Parameters:
sig- a new generic signature.- See Also:
SignatureAttribute.ObjectType.encode(),SignatureAttribute.MethodSignature.encode(),CtClass.setGenericSignature(String)
-
methodHead
CtMember methodHead()
-
lastMethod
CtMember lastMethod()
-
consHead
CtMember consHead()
-
lastCons
CtMember lastCons()
-
fieldHead
CtMember fieldHead()
-
lastField
CtMember lastField()
-
addMethod
void addMethod(CtMember method)
-
addConstructor
void addConstructor(CtMember cons)
-
addField
void addField(CtMember field)
-
remove
void remove(CtMember mem)
-
-