CtMember.Cache| Modifier and Type | Field and Description |
|---|---|
private CtMember |
consTail |
private CtMember |
fieldTail |
private CtMember |
methodTail |
declaringClass, next| Constructor and Description |
|---|
Cache(CtClassType decl) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
addConstructor(CtMember cons) |
(package private) void |
addField(CtMember field) |
(package private) void |
addMethod(CtMember method) |
(package private) CtMember |
consHead() |
(package private) static int |
count(CtMember head,
CtMember tail) |
protected void |
extendToString(java.lang.StringBuffer buffer)
Invoked by
CtMember.toString() to add to the buffer and provide the
complete value. |
(package private) CtMember |
fieldHead() |
java.lang.Object |
getAnnotation(java.lang.Class clz)
Returns the annotation if the class has the specified annotation class.
|
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.String |
getGenericSignature()
Returns the generic signature of the member.
|
int |
getModifiers()
Obtains the modifiers of the member.
|
java.lang.String |
getName()
Obtains the name of the member.
|
java.lang.String |
getSignature()
Returns the character string representing the signature of the member.
|
boolean |
hasAnnotation(java.lang.Class clz)
Returns true if the class has the specified annotation class.
|
(package private) CtMember |
lastCons() |
(package private) CtMember |
lastField() |
(package private) CtMember |
lastMethod() |
(package private) CtMember |
methodHead() |
(package private) void |
remove(CtMember mem) |
void |
setAttribute(java.lang.String name,
byte[] data)
Adds a user-defined attribute.
|
void |
setGenericSignature(java.lang.String sig)
Sets the generic signature of the member.
|
void |
setModifiers(int mod)
Sets the encoded modifiers of the member.
|
getDeclaringClass, nameReplaced, next, toString, visibleFromprivate CtMember methodTail
private CtMember consTail
private CtMember fieldTail
Cache(CtClassType decl)
protected void extendToString(java.lang.StringBuffer buffer)
CtMemberCtMember.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.extendToString in class CtMemberpublic boolean hasAnnotation(java.lang.Class clz)
CtMemberhasAnnotation in class CtMemberclz - the annotation class.true if the annotation is found, otherwise false.public java.lang.Object getAnnotation(java.lang.Class clz)
throws java.lang.ClassNotFoundException
CtMember@Author is associated
with this member, an Author object is returned.
The member values can be obtained by calling methods on
the Author object.getAnnotation in class CtMemberclz - the annotation class.null.java.lang.ClassNotFoundExceptionpublic java.lang.Object[] getAnnotations()
throws java.lang.ClassNotFoundException
CtMember@Author is associated
with this member, the returned array contains an Author
object. The member values can be obtained by calling methods on
the Author object.getAnnotations in class CtMemberjava.lang.ClassNotFoundExceptionCtClass.getAnnotations()public byte[] getAttribute(java.lang.String name)
CtMemberNote that an attribute is a data block specified by
the class file format.
See AttributeInfo.
getAttribute in class CtMembername - attribute namepublic java.lang.Object[] getAvailableAnnotations()
CtMembergetAnnotations()
except that, if any annotations are not on the classpath,
they are not included in the returned array.getAvailableAnnotations in class CtMemberCtMember.getAnnotations(),
CtClass.getAvailableAnnotations()public int getModifiers()
CtMembergetModifiers in class CtMemberjavassist.Modifier.Modifierpublic java.lang.String getName()
CtMemberAs for constructor names, see getName()
in CtConstructor.
getName in class CtMemberCtConstructor.getName()public java.lang.String getSignature()
CtMembergetSignature() returns the same string.getSignature in class CtMemberpublic void setAttribute(java.lang.String name,
byte[] data)
CtMemberNote that an attribute is a data block specified by
the class file format.
See AttributeInfo.
setAttribute in class CtMembername - attribute namedata - attribute valuepublic void setModifiers(int mod)
CtMembersetModifiers in class CtMemberModifierpublic java.lang.String getGenericSignature()
CtMembergetGenericSignature in class CtMemberSignatureAttribute.toFieldSignature(String),
SignatureAttribute.toMethodSignature(String),
CtClass.getGenericSignature()public void setGenericSignature(java.lang.String sig)
CtMembersetGenericSignature in class CtMembersig - a new generic signature.SignatureAttribute.ObjectType.encode(),
SignatureAttribute.MethodSignature.encode(),
CtClass.setGenericSignature(String)CtMember methodHead()
CtMember lastMethod()
CtMember consHead()
CtMember lastCons()
CtMember fieldHead()
CtMember lastField()
void addMethod(CtMember method)
void addConstructor(CtMember cons)
void addField(CtMember field)
void remove(CtMember mem)