at.dms.classfile
Class ConstantValueAttribute

java.lang.Object
  |
  +--at.dms.classfile.Attribute
        |
        +--at.dms.classfile.ConstantValueAttribute

public class ConstantValueAttribute
extends Attribute

Constant Value Attribute:. VMS 4.7.3. A ConstantValue attribute represents the value of a constant field that must be (explicitly or implicitly) static.


Fields inherited from class at.dms.classfile.Attribute
EMPTY
 
Constructor Summary
ConstantValueAttribute(java.io.DataInput in, ConstantPool cp)
          Constructs a constant value attribute from a class file stream.
ConstantValueAttribute(java.lang.Object value)
          Create a new constant attribute whose constant value is picked up from constant pool with the given entry.
 
Method Summary
(package private)  java.lang.Object getLiteral()
          Returns the value of the constant value attribute
(package private)  int getSize()
          Returns the space in bytes used by this attribute in the classfile
(package private)  int getTag()
          Returns the attribute's tag
(package private)  void resolveConstants(ConstantPool cp)
          Insert or check location of constant value on constant pool
(package private)  void write(ConstantPool cp, java.io.DataOutput out)
          Write this class into the the file (out) getting data position from the constant pool
 
Methods inherited from class at.dms.classfile.Attribute
read, readCodeInfoAttribute, readInterfaceOnly
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantValueAttribute

public ConstantValueAttribute(java.lang.Object value)
Create a new constant attribute whose constant value is picked up from constant pool with the given entry.
Parameters:
value - The value.

ConstantValueAttribute

public ConstantValueAttribute(java.io.DataInput in,
                              ConstantPool cp)
                       throws java.io.IOException,
                              ClassFileFormatException
Constructs a constant value attribute from a class file stream.
Parameters:
in - The stream to read from.
cp - The constant pool.
Throws:
java.io.IOException - An io problem has occured.
ClassFileFormatException - Attempt to write a bad classfile info.
Method Detail

getTag

int getTag()
Returns the attribute's tag
Overrides:
getTag in class Attribute

getSize

int getSize()
Returns the space in bytes used by this attribute in the classfile
Overrides:
getSize in class Attribute

getLiteral

java.lang.Object getLiteral()
Returns the value of the constant value attribute

resolveConstants

void resolveConstants(ConstantPool cp)
Insert or check location of constant value on constant pool
Overrides:
resolveConstants in class Attribute
Parameters:
cp - the constant pool for this class

write

void write(ConstantPool cp,
           java.io.DataOutput out)
     throws java.io.IOException
Write this class into the the file (out) getting data position from the constant pool
Overrides:
write in class Attribute
Parameters:
cp - the constant pool that contain all data
out - the file where to write this object info
Throws:
java.io.IOException - an io problem has occured