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) void
addConstructor
(CtMember cons) (package private) void
(package private) void
(package private) CtMember
consHead()
(package private) static int
protected void
extendToString
(StringBuilder buffer) Invoked byCtMember.toString()
to add to the buffer and provide the complete value.(package private) CtMember
getAnnotation
(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.int
Obtains the modifiers of the member.getName()
Obtains the name of the member.Returns the character string representing the signature of the member.boolean
hasAnnotation
(String clz) Returns true if the class has the specified annotation type.(package private) CtMember
lastCons()
(package private) CtMember
(package private) CtMember
(package private) CtMember
(package private) void
void
setAttribute
(String name, byte[] data) Adds a user-defined attribute.void
Sets the generic signature of the member.void
setModifiers
(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:CtMember
Invoked 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:
extendToString
in classCtMember
-
hasAnnotation
Description copied from class:CtMember
Returns true if the class has the specified annotation type.- Specified by:
hasAnnotation
in classCtMember
- Parameters:
clz
- the name of annotation type.- Returns:
true
if the annotation is found, otherwisefalse
.
-
getAnnotation
Description copied from class:CtMember
Returns the annotation if the class has the specified annotation type. For example, if an annotation@Author
is associated with this member, anAuthor
object is returned. The member values can be obtained by calling methods on theAuthor
object.- Specified by:
getAnnotation
in classCtMember
- Parameters:
clz
- the annotation type.- Returns:
- the annotation if found, otherwise
null
. - Throws:
ClassNotFoundException
-
getAnnotations
Description copied from class:CtMember
Returns the annotations associated with this member. For example, if an annotation@Author
is associated with this member, the returned array contains anAuthor
object. The member values can be obtained by calling methods on theAuthor
object.- Specified by:
getAnnotations
in classCtMember
- Returns:
- an array of annotation-type objects.
- Throws:
ClassNotFoundException
- See Also:
-
getAttribute
Description copied from class:CtMember
Obtains 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:
getAttribute
in classCtMember
- Parameters:
name
- attribute name
-
getAvailableAnnotations
Description copied from class:CtMember
Returns 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:
getAvailableAnnotations
in classCtMember
- Returns:
- an array of annotation-type objects.
- See Also:
-
getModifiers
public int getModifiers()Description copied from class:CtMember
Obtains the modifiers of the member.- Specified by:
getModifiers
in classCtMember
- Returns:
- modifiers encoded with
javassist.Modifier
. - See Also:
-
getName
Description copied from class:CtMember
Obtains the name of the member.As for constructor names, see
getName()
inCtConstructor
. -
getSignature
Description copied from class:CtMember
Returns 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:
getSignature
in classCtMember
-
setAttribute
Description copied from class:CtMember
Adds 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:
setAttribute
in classCtMember
- Parameters:
name
- attribute namedata
- attribute value
-
setModifiers
public void setModifiers(int mod) Description copied from class:CtMember
Sets the encoded modifiers of the member.- Specified by:
setModifiers
in classCtMember
- See Also:
-
getGenericSignature
Description copied from class:CtMember
Returns the generic signature of the member.- Specified by:
getGenericSignature
in classCtMember
- See Also:
-
setGenericSignature
Description copied from class:CtMember
Sets the generic signature of the member.- Specified by:
setGenericSignature
in 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
-