This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
commit 0ecd1dd356016320f47d9c9e8a36ee23497b3fa9 Author: Gary Gregory <[email protected]> AuthorDate: Sat Jan 10 22:01:21 2026 -0500 Javadoc --- .../apache/bcel/classfile/ElementValuePair.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/main/java/org/apache/bcel/classfile/ElementValuePair.java b/src/main/java/org/apache/bcel/classfile/ElementValuePair.java index ec57d33b..fa0dac79 100644 --- a/src/main/java/org/apache/bcel/classfile/ElementValuePair.java +++ b/src/main/java/org/apache/bcel/classfile/ElementValuePair.java @@ -36,29 +36,62 @@ public class ElementValuePair { private final int elementNameIndex; + /** + * Constructs an ElementValuePair. + * + * @param elementNameIndex the element name index. + * @param elementValue the element value. + * @param constantPool the constant pool. + */ public ElementValuePair(final int elementNameIndex, final ElementValue elementValue, final ConstantPool constantPool) { this.elementValue = elementValue; this.elementNameIndex = elementNameIndex; this.constantPool = constantPool; } + /** + * Dumps this element value pair to a DataOutputStream. + * + * @param dos the output stream. + * @throws IOException if an I/O error occurs. + */ protected void dump(final DataOutputStream dos) throws IOException { dos.writeShort(elementNameIndex); // u2 name of the element elementValue.dump(dos); } + /** + * Gets the name index. + * + * @return the name index. + */ public int getNameIndex() { return elementNameIndex; } + /** + * Gets the name string. + * + * @return the name string. + */ public String getNameString() { return constantPool.getConstantUtf8(elementNameIndex).getBytes(); } + /** + * Gets the value. + * + * @return the element value. + */ public final ElementValue getValue() { return elementValue; } + /** + * Gets a short string representation. + * + * @return a short string representation. + */ public String toShortString() { final StringBuilder result = new StringBuilder(); result.append(getNameString()).append("=").append(getValue().toShortString());
