Package javassist
Class CtMember.Cache
java.lang.Object
javassist.CtMember
javassist.CtMember.Cache
- Enclosing class:
- CtMember
-
Nested Class Summary
Nested classes/interfaces inherited from class javassist.CtMember
CtMember.Cache -
Field Summary
FieldsFields inherited from class javassist.CtMember
declaringClass, next -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddConstructor(CtMember cons) (package private) void(package private) void(package private) CtMemberconsHead()(package private) static intprotected voidextendToString(StringBuilder buffer) Invoked byCtMember.toString()to add to the buffer and provide the complete value.(package private) CtMembergetAnnotation(Class<?> clz) Returns the annotation if the class has the specified annotation type.Object[]Returns the annotations associated with this member.byte[]getAttribute(String name) Obtains a user-defined attribute with the given name.Object[]Returns the annotations associated with this member.Returns the generic signature of the member.intObtains the modifiers of the member.getName()Obtains the name of the member.Returns the character string representing the signature of the member.booleanhasAnnotation(String clz) Returns true if the class has the specified annotation type.(package private) CtMemberlastCons()(package private) CtMember(package private) CtMember(package private) CtMember(package private) voidvoidsetAttribute(String name, byte[] data) Adds a user-defined attribute.voidSets 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
-
Field Details
-
methodTail
-
consTail
-
fieldTail
-
-
Constructor Details
-
Cache
Cache(CtClassType decl)
-
-
Method Details
-
extendToString
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
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
Description 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:
ClassNotFoundException
-
getAnnotations
Description 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:
ClassNotFoundException- See Also:
-
getAttribute
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
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:
-
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:
-
getName
Description copied from class:CtMemberObtains the name of the member.As for constructor names, see
getName()inCtConstructor. -
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
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:
-
getGenericSignature
Description copied from class:CtMemberReturns the generic signature of the member.- Specified by:
getGenericSignaturein classCtMember- See Also:
-
setGenericSignature
Description copied from class:CtMemberSets the generic signature of the member.- Specified by:
setGenericSignaturein classCtMember- Parameters:
sig- a new generic signature.- See Also:
-
methodHead
CtMember methodHead() -
lastMethod
CtMember lastMethod() -
consHead
CtMember consHead() -
lastCons
CtMember lastCons() -
fieldHead
CtMember fieldHead() -
lastField
CtMember lastField() -
addMethod
-
addConstructor
-
addField
-
count
-
remove
-