public abstract class CtMember
extends java.lang.Object
CtMember represents a field, a constructor,
or a method.| Modifier and Type | Method and Description |
|---|---|
abstract java.lang.Object[] |
getAnnotations()
Returns the annotations associated with this member.
|
abstract byte[] |
getAttribute(java.lang.String name)
Obtains a user-defined attribute with the given name.
|
abstract java.lang.Object[] |
getAvailableAnnotations()
Returns the annotations associated with this member.
|
CtClass |
getDeclaringClass()
Returns the class that declares this member.
|
abstract int |
getModifiers()
Obtains the modifiers of the member.
|
abstract java.lang.String |
getName()
Obtains the name of the member.
|
abstract java.lang.String |
getSignature()
Returns the character string representing the signature of the member.
|
abstract void |
setAttribute(java.lang.String name,
byte[] data)
Adds a user-defined attribute.
|
abstract void |
setModifiers(int mod)
Sets the encoded modifiers of the member.
|
java.lang.String |
toString() |
boolean |
visibleFrom(CtClass clazz)
Returns true if this member is accessible from the given class.
|
public java.lang.String toString()
toString in class java.lang.Objectpublic CtClass getDeclaringClass()
public boolean visibleFrom(CtClass clazz)
public abstract int getModifiers()
javassist.Modifier.Modifierpublic abstract void setModifiers(int mod)
Modifierpublic abstract java.lang.Object[] getAnnotations()
throws java.lang.ClassNotFoundException
@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.java.lang.ClassNotFoundExceptionCtClass.getAnnotations()public abstract java.lang.Object[] getAvailableAnnotations()
throws java.lang.ClassNotFoundException
getAnnotations()
except that, if any annotations are not on the classpath,
they are not included in the returned array.java.lang.ClassNotFoundExceptiongetAnnotations(),
CtClass.getAvailableAnnotations()public abstract java.lang.String getName()
As for constructor names, see getName()
in CtConstructor.
CtConstructor.getName()public abstract java.lang.String getSignature()
getSignature() returns the same string.public abstract byte[] getAttribute(java.lang.String name)
Note that an attribute is a data block specified by
the class file format.
See AttributeInfo.
name - attribute namepublic abstract void setAttribute(java.lang.String name,
byte[] data)
Note that an attribute is a data block specified by
the class file format.
See AttributeInfo.
name - attribute namedata - attribute valueJavassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.