mjc

org.multijava.util.classfile
Class AnnotBooleanElementValue

java.lang.Object
  extended byorg.multijava.util.classfile.AnnotElementValue
      extended byorg.multijava.util.classfile.AnnotBooleanElementValue

public class AnnotBooleanElementValue
extends AnnotElementValue

A class representing a boolean value in an element-value pair of an annotation structure.

Author:
AHS
See Also:
Annotation.ElementValuePair

Field Summary
private  IntegerConstant value
          the constant pool entry for this value
 
Constructor Summary
AnnotBooleanElementValue(boolean value)
          Construct a new element-value with the given value.
AnnotBooleanElementValue(ConstantPool cp, DataInput in)
          Construct a new element-value from a classfile stream.
 
Method Summary
 int getSize()
          Return the size in bytes that this value takes up in the class file (not including the tag).
 void resolveConstants(ConstantPool cp)
          Insert or check location of constant value on constant pool.
 String toString()
          Return a textual representation of the value.
 boolean value()
          Return the encapsulated value.
 void write(ConstantPool cp, DataOutput out)
          Write this value to a classfile stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

private IntegerConstant value
the constant pool entry for this value

Constructor Detail

AnnotBooleanElementValue

public AnnotBooleanElementValue(boolean value)
Construct a new element-value with the given value.


AnnotBooleanElementValue

public AnnotBooleanElementValue(ConstantPool cp,
                                DataInput in)
                         throws IOException
Construct a new element-value from a classfile stream.

Parameters:
cp - the constant pool
in - the input stream to read from
Throws:
IOException - an IO exception has occurred
Method Detail

resolveConstants

public void resolveConstants(ConstantPool cp)
Insert or check location of constant value on constant pool.

Parameters:
cp - the constant pool for this class

write

public void write(ConstantPool cp,
                  DataOutput out)
           throws IOException
Write this value to a classfile stream.

Parameters:
cp - the constant pool
out - the output stream
Throws:
IOException - an IO error has occurred

getSize

public int getSize()
Return the size in bytes that this value takes up in the class file (not including the tag).


toString

public String toString()
Return a textual representation of the value.

Specified by:
toString in class AnnotElementValue

value

public boolean value()
Return the encapsulated value.


mjc

mjc is Copyright (C) 2000-2004 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. mjc is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.