classUtils.javassist
Class CtMember

java.lang.Object
  extended by classUtils.javassist.CtMember
Direct Known Subclasses:
CtBehavior, CtField

public abstract class CtMember
extends java.lang.Object

An instance of CtMember represents a field, a constructor, or a method.


Method Summary
abstract  byte[] getAttribute(java.lang.String name)
          Obtains an attribute with the given name.
 CompileTimeClass 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  void setAttribute(java.lang.String name, byte[] data)
          Adds an attribute.
abstract  void setModifiers(int mod)
          Sets the encoded modifiers of the member.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDeclaringClass

public CompileTimeClass getDeclaringClass()
Returns the class that declares this member.


getModifiers

public abstract int getModifiers()
Obtains the modifiers of the member.

Returns:
modifiers encoded with javassist.Modifier.
See Also:
Modifier

setModifiers

public abstract void setModifiers(int mod)
Sets the encoded modifiers of the member.

See Also:
Modifier

getName

public abstract java.lang.String getName()
Obtains the name of the member.


getAttribute

public abstract byte[] getAttribute(java.lang.String name)
Obtains an attribute with the given name. If that attribute is not found in the class file, this method returns null.

Parameters:
name - attribute name

setAttribute

public abstract void setAttribute(java.lang.String name,
                                  byte[] data)
Adds an attribute. The attribute is saved in the class file.

Parameters:
name - attribute name
data - attribute value