javassist
Class CtMember

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

Method Detail

toString

public java.lang.String toString()

getDeclaringClass

public CtClass 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.

As for constructor names, see getName() in CtConstructor.

See Also:
CtConstructor.getName()

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


Javassist, a Java-bytecode translator toolkit. Copyright (C) 1999-2005 Shigeru Chiba. All Rights Reserved.