|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.claritysys.jvm.classfile.CfEntry
com.claritysys.jvm.classfile.CfFieldOrMethod
com.claritysys.jvm.classfile.CfField
public class CfField
A field declared within a ClassFile.
Fields are organized into a linked list within our ClassFile, rather than an array, to allow for efficient dynamic growth.
| Constructor Summary | |
|---|---|
CfField(ClassFile classFile)
|
|
| Method Summary | |
|---|---|
CpEntry |
getConstantValue()
|
CfField |
getNext()
|
CpRef |
getRef()
Return a Cp(Method)Ref for invoking this method. |
boolean |
handleAttribute(java.io.DataInputStream dataIn,
java.lang.String name,
int length)
For fields we must recognize: ConstantValue, Synthetic, Deprecated. |
void |
read(java.io.DataInputStream dataIn)
Read the member from the given stream, overwriting any previous values. |
void |
setConstantValue(CpEntry constantValue)
|
void |
setNext(CfField next)
|
void |
write(java.io.DataOutput dout)
Write the field or method to a stream in JVM classfile format. |
| Methods inherited from class com.claritysys.jvm.classfile.CfFieldOrMethod |
|---|
getClassFile, getConstantPool, getDescriptorIndex, getName, getNameIndex, getSignature, isSynthetic, setDescriptorIndex, setNameIndex, setSynthetic |
| Methods inherited from class com.claritysys.jvm.classfile.CfEntry |
|---|
getAccessFlags, getAttributeCount, getAttributes, isAbstract, isDeprecated, isFinal, isInterface, isNative, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isTransient, isVolatile, setAbstract, setAccessFlags, setAttributes, setDeprecated, setFinal, setInterface, setNative, setPrivate, setProtected, setPublic, setStatic, setStrict, setSynchronized, setTransient, setVolatile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CfField(ClassFile classFile)
classFile - | Method Detail |
|---|
public CfField getNext()
public void setNext(CfField next)
public CpEntry getConstantValue()
public void setConstantValue(CpEntry constantValue)
public void read(java.io.DataInputStream dataIn)
throws java.io.IOException,
ClassFileFormatException
CfFieldOrMethodSubclasses must override this method, first invoking this one, and then processing attributes.
field_info {
u2 access_flags;
u2 name_index;
u2 descriptor_index;
u2 attributes_count;
attribute_info attributes[attributes_count];
}
method_info {
u2 access_flags;
u2 name_index;
u2 descriptor_index;
u2 attributes_count;
attribute_info attributes[attributes_count];
}
read in class CfFieldOrMethodjava.io.IOException
ClassFileFormatException
public boolean handleAttribute(java.io.DataInputStream dataIn,
java.lang.String name,
int length)
throws java.io.IOException,
ClassFileFormatException
handleAttribute in interface AttributeHandlerdataIn - DataInputStream, positioned to attribute's data.name - Attribute name from constant pool.length - Length of info[] in bytes.
java.io.IOException - If an I/O error ocurrs.
ClassFileFormatException - If the attribute was processed but
was incorrectly formed.
public void write(java.io.DataOutput dout)
throws java.io.IOException
CfFieldOrMethodSubclasses must override this and extend the behavior by writing the attribute table.
write in class CfFieldOrMethodjava.io.IOExceptionpublic CpRef getRef()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||