|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jode.bytecode.BinaryInfo
net.sf.jode.bytecode.FieldInfo
Represents a java bytecode field (class variable). A field consists of the following parts:
type signature
in bytecode format.type signature
in bytecode format including template information.Modifier.PUBLIC
,
Modifier.PRIVATE
, Modifier.PROTECTED
,
Modifier.STATIC
, Modifier.FINAL
,
Modifier.VOLATILE
, Modifier.TRANSIENT
,
Modifier.STRICT
of class Modifier
.
TypeSignature
,
BasicBlocks
Field Summary |
Fields inherited from class net.sf.jode.bytecode.BinaryInfo |
ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE |
Constructor Summary | |
FieldInfo()
Creates a new empty field info. |
|
FieldInfo(java.lang.String name,
java.lang.String typeSig,
int modifier)
Creates a new field with given name, type and modifiers. |
Method Summary | |
int |
compareTo(java.lang.Object other)
Compares two FieldInfo objects for field order. |
protected void |
drop(int keep)
Drops information from this info. |
protected int |
getAttributeCount()
Returns the number of attributes of this class. |
java.lang.Object |
getConstant()
Gets the constant value of the field. |
int |
getModifiers()
Gets the modifier of the field. |
java.lang.String |
getName()
Gets the name of the field. |
java.lang.String |
getSignature()
Gets the type signature including template information of the field. |
java.lang.String |
getType()
Gets the type signature of the field. |
boolean |
isDeprecated()
Tells whether this field is deprecated. |
boolean |
isSynthetic()
Tells whether this field is synthetic. |
protected void |
readAttribute(java.lang.String name,
int length,
ConstantPool cp,
java.io.DataInputStream input,
int howMuch)
Reads in an attributes of this class. |
void |
setConstant(java.lang.Object newConstant)
|
void |
setDeprecated(boolean flag)
|
void |
setModifiers(int newModifier)
Sets the modifier of the field. |
void |
setName(java.lang.String newName)
Sets the name of the field. |
void |
setSynthetic(boolean flag)
|
void |
setType(java.lang.String newType)
Sets the type signature of the field. |
java.lang.String |
toString()
|
protected void |
writeAttributes(GrowableConstantPool gcp,
java.io.DataOutputStream output)
Writes the attributes to the output stream. |
Methods inherited from class net.sf.jode.bytecode.BinaryInfo |
addAttribute, findAttribute, getAttributes, getAttributeSize, prepareAttributes, removeAllAttributes, removeAttribute |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FieldInfo()
public FieldInfo(java.lang.String name, java.lang.String typeSig, int modifier)
name
- the name of the field.typeSig
- the typeSig the type signature.modifier
- the modifierTypeSignature
,
Modifier
Method Detail |
protected void readAttribute(java.lang.String name, int length, ConstantPool cp, java.io.DataInputStream input, int howMuch) throws java.io.IOException
BinaryInfo
readAttribute
in class BinaryInfo
name
- the attribute name.length
- the length of the attribute.cp
- the constant pool of the class.input
- a data input stream where you can read the attribute
from. It will protect you to read more over the attribute boundary.howMuch
- the constant that was given to the ClassInfo.load(int)
function when loading this class.
java.io.IOException
protected int getAttributeCount()
BinaryInfo
getAttributeCount
in class BinaryInfo
protected void writeAttributes(GrowableConstantPool gcp, java.io.DataOutputStream output) throws java.io.IOException
BinaryInfo
Writes the attributes to the output stream.
Overwrite this method if you want to add your own attributes.
All constants you need from the growable constant pool must
have been previously registered by the BinaryInfo.prepareAttributes(net.sf.jode.bytecode.GrowableConstantPool)
method. This method must not add new constants to the pool
writeAttributes
in class BinaryInfo
gcp
- The growable constant pool, which is not
growable anymore (see above).output
- the data output stream. You must write exactly
as many bytes to it as you have told with the BinaryInfo.getAttributeSize()
method.
java.io.IOException
protected void drop(int keep)
BinaryInfo
drop
in class BinaryInfo
keep
- the constant representing how much information we
should keep (see ClassInfo.load(int)
).public java.lang.String getName()
public java.lang.String getType()
TypeSignature
public java.lang.String getSignature()
TypeSignature
public int getModifiers()
Modifier
public boolean isSynthetic()
public boolean isDeprecated()
public java.lang.Object getConstant()
public void setName(java.lang.String newName)
newName
- the name.public void setType(java.lang.String newType)
newType
- the type signature.TypeSignature
public void setModifiers(int newModifier)
newModifier
- the modifiers.Modifier
public void setSynthetic(boolean flag)
public void setDeprecated(boolean flag)
public void setConstant(java.lang.Object newConstant)
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
java.lang.ClassCastException
- if other is not a ClassInfo.public java.lang.String toString()
|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |