koala.dynamicjava.classfile
Class FieldInfo

java.lang.Object
  |
  +--koala.dynamicjava.classfile.BytecodeComponent
        |
        +--koala.dynamicjava.classfile.AttributeOwnerComponent
              |
              +--koala.dynamicjava.classfile.FieldInfo

public class FieldInfo
extends AttributeOwnerComponent

This class allows the creation of JVM bytecode field format outputs


Fields inherited from class koala.dynamicjava.classfile.AttributeOwnerComponent
accessFlags, attributes
 
Fields inherited from class koala.dynamicjava.classfile.BytecodeComponent
constantPool, nameIndex
 
Constructor Summary
FieldInfo(ConstantPool cp, java.lang.String tp, java.lang.String nm)
          Creates a new field info
 
Method Summary
 void setConstantValueAttribute(java.lang.Double value)
          Sets the constant value attribute for this field to a double value.
 void setConstantValueAttribute(java.lang.Float value)
          Sets the constant value attribute for this field to a float value.
 void setConstantValueAttribute(java.lang.Integer value)
          Sets the constant value attribute for this field to an integer value.
 void setConstantValueAttribute(java.lang.Long value)
          Sets the constant value attribute for this field to a long value.
 void setConstantValueAttribute(java.lang.String value)
          Sets the constant value attribute for this field to a string value.
 void setFinal()
          Sets the final flag for this class
 void setPrivate()
          Sets the private flag for this class
 void setProtected()
          Sets the protected flag for this class
 void setPublic()
          Sets the public flag for this class
 void setStatic()
          Sets the static flag for this class
 void setTransient()
          Sets the transient flag for this class
 void setVolatile()
          Sets the volatile flag for this class
 void write(java.io.DataOutputStream out)
          Writes the field info to the given output stream
 
Methods inherited from class koala.dynamicjava.classfile.AttributeOwnerComponent
setAccessFlags, setSyntheticAttribute
 
Methods inherited from class koala.dynamicjava.classfile.BytecodeComponent
getConstantPool, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldInfo

public FieldInfo(ConstantPool cp,
                 java.lang.String tp,
                 java.lang.String nm)
Creates a new field info
Parameters:
cp - the constant pool where constants are stored
tp - the type name. The type name must be fully qualified.

The following strings are valid class names:

  • "int"
  • "Z"
  • "java.lang.String"
  • "java.lang.Object[][]"
  • "Ljava/lang/String;"
  • "[[Ljava/lang/Integer;"
nm - the name of the field
Method Detail

write

public void write(java.io.DataOutputStream out)
           throws java.io.IOException
Writes the field info to the given output stream
Overrides:
write in class BytecodeComponent

setPublic

public void setPublic()
Sets the public flag for this class

setPrivate

public void setPrivate()
Sets the private flag for this class

setProtected

public void setProtected()
Sets the protected flag for this class

setStatic

public void setStatic()
Sets the static flag for this class

setFinal

public void setFinal()
Sets the final flag for this class

setVolatile

public void setVolatile()
Sets the volatile flag for this class

setTransient

public void setTransient()
Sets the transient flag for this class

setConstantValueAttribute

public void setConstantValueAttribute(java.lang.Integer value)
Sets the constant value attribute for this field to an integer value.

setConstantValueAttribute

public void setConstantValueAttribute(java.lang.Long value)
Sets the constant value attribute for this field to a long value.

setConstantValueAttribute

public void setConstantValueAttribute(java.lang.Float value)
Sets the constant value attribute for this field to a float value.

setConstantValueAttribute

public void setConstantValueAttribute(java.lang.Double value)
Sets the constant value attribute for this field to a double value.

setConstantValueAttribute

public void setConstantValueAttribute(java.lang.String value)
Sets the constant value attribute for this field to a string value.


Copyright © 2001 Stephane Hillion. All Rights Reserved.