jasm.attributes
Class ConstantValue

java.lang.Object
  extended by jasm.attributes.ConstantValue
All Implemented Interfaces:
BytecodeAttribute

public class ConstantValue
extends java.lang.Object
implements BytecodeAttribute


Nested Class Summary
 
Nested classes/interfaces inherited from interface jasm.lang.BytecodeAttribute
BytecodeAttribute.Fn, BytecodeAttribute.Reader, BytecodeAttribute.Unknown
 
Constructor Summary
ConstantValue(java.lang.Object constant)
          A ConstantValue attribute.
 
Method Summary
 void addPoolItems(java.util.Set<Constant.Info> constantPool)
          When this method is called, the attribute must add all items that it needs to the constant pool.
 java.lang.Object constant()
           
 java.lang.String name()
           
 void print(java.io.PrintWriter output, java.util.Map<Constant.Info,java.lang.Integer> constantPool)
          This method is used to print the contents of the attribute in human-readable form, similar to that produced by "javap".
 void write(BinaryOutputStream writer, java.util.Map<Constant.Info,java.lang.Integer> constantPool)
          This method requires the attribute to write itself to the binary stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantValue

public ConstantValue(java.lang.Object constant)
A ConstantValue attribute. Here, the constant must be either an instanceof of Boolean, Byte, Character, Short, Integer, Float, Double or String.

Parameters:
constant -
Method Detail

name

public java.lang.String name()
Specified by:
name in interface BytecodeAttribute

constant

public java.lang.Object constant()

addPoolItems

public void addPoolItems(java.util.Set<Constant.Info> constantPool)
Description copied from interface: BytecodeAttribute
When this method is called, the attribute must add all items that it needs to the constant pool.

Specified by:
addPoolItems in interface BytecodeAttribute

write

public void write(BinaryOutputStream writer,
                  java.util.Map<Constant.Info,java.lang.Integer> constantPool)
           throws java.io.IOException
Description copied from interface: BytecodeAttribute
This method requires the attribute to write itself to the binary stream.

Specified by:
write in interface BytecodeAttribute
Throws:
java.io.IOException

print

public void print(java.io.PrintWriter output,
                  java.util.Map<Constant.Info,java.lang.Integer> constantPool)
           throws java.io.IOException
Description copied from interface: BytecodeAttribute
This method is used to print the contents of the attribute in human-readable form, similar to that produced by "javap".

Specified by:
print in interface BytecodeAttribute
Throws:
java.io.IOException


Copyright © 2013 David J. Pearce. All Rights Reserved.