Package org.apache.bcel.generic
Class ElementValuePairGen
- java.lang.Object
-
- org.apache.bcel.generic.ElementValuePairGen
-
public class ElementValuePairGen extends java.lang.ObjectGenerates element value pairs in annotations.- Since:
- 6.0
-
-
Field Summary
Fields Modifier and Type Field Description private ConstantPoolGenconstantPoolGenprivate intnameIdxprivate ElementValueGenvalue
-
Constructor Summary
Constructors Modifier Constructor Description protectedElementValuePairGen(int idx, ElementValueGen value, ConstantPoolGen cpool)Constructs an ElementValuePairGen.ElementValuePairGen(java.lang.String name, ElementValueGen value, ConstantPoolGen cpool)Constructs an ElementValuePairGen.ElementValuePairGen(ElementValuePair nvp, ConstantPoolGen cpool, boolean copyPoolEntries)Constructs an ElementValuePairGen from an ElementValuePair.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddump(java.io.DataOutputStream dos)Dumps this element value pair to a DataOutputStream.ElementValuePairgetElementNameValuePair()Retrieves an immutable version of this ElementValuePairGen.intgetNameIndex()Gets the name index.java.lang.StringgetNameString()Gets the name string.ElementValueGengetValue()Gets the value.java.lang.StringtoString()
-
-
-
Field Detail
-
nameIdx
private final int nameIdx
-
value
private final ElementValueGen value
-
constantPoolGen
private final ConstantPoolGen constantPoolGen
-
-
Constructor Detail
-
ElementValuePairGen
public ElementValuePairGen(ElementValuePair nvp, ConstantPoolGen cpool, boolean copyPoolEntries)
Constructs an ElementValuePairGen from an ElementValuePair.- Parameters:
nvp- the element value pair.cpool- the constant pool.copyPoolEntries- whether to copy pool entries.
-
ElementValuePairGen
protected ElementValuePairGen(int idx, ElementValueGen value, ConstantPoolGen cpool)Constructs an ElementValuePairGen.- Parameters:
idx- the name index.value- the element value.cpool- the constant pool.
-
ElementValuePairGen
public ElementValuePairGen(java.lang.String name, ElementValueGen value, ConstantPoolGen cpool)Constructs an ElementValuePairGen.- Parameters:
name- the name.value- the element value.cpool- the constant pool.
-
-
Method Detail
-
dump
protected void dump(java.io.DataOutputStream dos) throws java.io.IOExceptionDumps this element value pair to a DataOutputStream.- Parameters:
dos- the output stream.- Throws:
java.io.IOException- if an I/O error occurs.
-
getElementNameValuePair
public ElementValuePair getElementNameValuePair()
Retrieves an immutable version of this ElementValuePairGen.- Returns:
- an immutable ElementValuePair.
-
getNameIndex
public int getNameIndex()
Gets the name index.- Returns:
- the name index.
-
getNameString
public final java.lang.String getNameString()
Gets the name string.- Returns:
- the name string.
-
getValue
public final ElementValueGen getValue()
Gets the value.- Returns:
- the element value.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-