fr.umlv.corosol.classfile.attribute.impl
Class DefaultJConstantValueAttribute

java.lang.Object
  extended by fr.umlv.corosol.classfile.attribute.impl.AbstractJAttribute
      extended by fr.umlv.corosol.classfile.attribute.impl.DefaultJConstantValueAttribute
All Implemented Interfaces:
JAttribute, JConstantValueAttribute, JClassFileItem, JObject

public class DefaultJConstantValueAttribute
extends AbstractJAttribute
implements JConstantValueAttribute

The default implementation of the JConstantValueAttribute interface.

Author:
Christophe Deleray

Field Summary
 
Fields inherited from interface fr.umlv.corosol.classfile.attribute.JAttribute
CODE, CONSTANT_VALUE, DEPRECATED, EXCEPTIONS, INNER_CLASSES, LINE_NUMBER_TABLE, LOCAL_VARIABLE_TABLE, SOURCE_FILE, SYNTHETIC
 
Constructor Summary
DefaultJConstantValueAttribute()
          The default constructor.
 
Method Summary
 JConstant getConstant()
          Returns the JConstant object which contains the value of a static field.
 java.lang.String getName()
          Returns the attribute name.
 int getSize()
          Returns the size of the attribute in bytes.
 void readItem(JClassFileInput in)
          Extracts the data of this attribute from the specified input stream.
 java.lang.String toString()
          Returns a string representation of this attribute.
 void writeItem(JClassFileOutput out)
          Writes the data of this attribute into a file via the specified output stream.
 
Methods inherited from class fr.umlv.corosol.classfile.attribute.impl.AbstractJAttribute
getConstantPool, setConstantPool
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fr.umlv.corosol.classfile.JClassFileItem
getConstantPool, setConstantPool
 

Constructor Detail

DefaultJConstantValueAttribute

public DefaultJConstantValueAttribute()
The default constructor.

Method Detail

getName

public java.lang.String getName()
Returns the attribute name.

Specified by:
getName in interface JAttribute
Overrides:
getName in class AbstractJAttribute

getSize

public int getSize()
Returns the size of the attribute in bytes.

Specified by:
getSize in interface JAttribute
Specified by:
getSize in class AbstractJAttribute

readItem

public void readItem(JClassFileInput in)
              throws java.io.IOException
Extracts the data of this attribute from the specified input stream.

Specified by:
readItem in interface JClassFileItem
Parameters:
in - a class file input stream
Throws:
java.io.IOException - if an I/O error occurs when reading the datas of this attribute

writeItem

public void writeItem(JClassFileOutput out)
               throws java.io.IOException
Writes the data of this attribute into a file via the specified output stream.

Specified by:
writeItem in interface JClassFileItem
Parameters:
out - a class file output stream
Throws:
java.io.IOException - if an I/O error occurs when writing into the classfile

getConstant

public JConstant getConstant()
Returns the JConstant object which contains the value of a static field.

Specified by:
getConstant in interface JConstantValueAttribute
See Also:
JConstant

toString

public java.lang.String toString()
Returns a string representation of this attribute.

Specified by:
toString in interface JAttribute
Specified by:
toString in class AbstractJAttribute
Returns:
a string representing this classfile attribute