mjc

org.multijava.util.classfile
Class Annotation.ElementValuePair

java.lang.Object
  extended byorg.multijava.util.classfile.Annotation.ElementValuePair
Enclosing class:
Annotation

private class Annotation.ElementValuePair
extends Object

Nested class representing name/value pair in an annotation structure.


Field Summary
private  AsciiConstant name
          the pooled constant holding the name of the pair
private  AnnotElementValue value
          the value of the pair
 
Constructor Summary
Annotation.ElementValuePair(String name, AnnotElementValue value)
          Construct a new element-value pair for an annotation structure.
Annotation.ElementValuePair(ConstantPool cp, DataInput in)
          Construct an element-value pair in an annotation structure from a classfile stream.
 
Method Summary
protected  int getSize()
          Return the size in bytes of this element-value pair.
 String name()
          Return the name of this element-value pair.
(package private)  void resolveConstants(ConstantPool cp)
          Insert or check location of constant value on constant pool.
 String toString()
          Return a string representation of this element-value pair.
 AnnotElementValue value()
          Return the value of this element-value pair.
(package private)  void write(ConstantPool cp, DataOutput out)
          Write this element-value pair to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private AsciiConstant name
the pooled constant holding the name of the pair


value

private AnnotElementValue value
the value of the pair

Constructor Detail

Annotation.ElementValuePair

public Annotation.ElementValuePair(String name,
                                   AnnotElementValue value)
Construct a new element-value pair for an annotation structure.

Parameters:
name - the name of the pair
value - the value of the pair

Annotation.ElementValuePair

public Annotation.ElementValuePair(ConstantPool cp,
                                   DataInput in)
                            throws IOException,
                                   ClassFileFormatException
Construct an element-value pair in an annotation structure from a classfile stream.

Parameters:
cp - the constant pool
in - the stream to read from
Throws:
IOException - an IO exception has occured
ClassFileFormatException - the pair is malformed
Method Detail

resolveConstants

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

Parameters:
cp - the constant pool for this class

write

void write(ConstantPool cp,
           DataOutput out)
     throws IOException
Write this element-value pair to a stream.

Parameters:
cp - the constant pool
out - the output stream
Throws:
IOException - an IO exception has occured

getSize

protected int getSize()
Return the size in bytes of this element-value pair.


toString

public String toString()
Return a string representation of this element-value pair.

Overrides:
toString in class Object

value

public AnnotElementValue value()
Return the value of this element-value pair.


name

public String name()
Return the name of this element-value pair.


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.