aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/ClassFile.java
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2016-09-18 23:49:43 +0900
committerchibash <chiba@javassist.org>2016-09-18 23:49:43 +0900
commit0e9ff9fd2bdf9ae928c7596714672a2baec01281 (patch)
tree43578517e2a79e27ac5732b6f31b6b337dc988db /src/main/javassist/bytecode/ClassFile.java
parent460d41808ae623c5e60c89bcafb0aa79176d2dd8 (diff)
downloadjavassist-0e9ff9fd2bdf9ae928c7596714672a2baec01281.tar.gz
javassist-0e9ff9fd2bdf9ae928c7596714672a2baec01281.zip
enables removal of attributes
Diffstat (limited to 'src/main/javassist/bytecode/ClassFile.java')
-rw-r--r--src/main/javassist/bytecode/ClassFile.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/ClassFile.java b/src/main/javassist/bytecode/ClassFile.java
index 887ec7a3..f53ff149 100644
--- a/src/main/javassist/bytecode/ClassFile.java
+++ b/src/main/javassist/bytecode/ClassFile.java
@@ -761,6 +761,11 @@ public final class ClassFile {
* Returns the attribute with the specified name. If there are multiple
* attributes with that name, this method returns either of them. It
* returns null if the specified attributed is not found.
+ *
+ * <p>An attribute name can be obtained by, for example,
+ * {@link AnnotationsAttribute#visibleTab} or
+ * {@link AnnotationsAttribute#invisibleTab}.
+ * </p>
*
* @param name attribute name
* @see #getAttributes()
@@ -778,6 +783,17 @@ public final class ClassFile {
}
/**
+ * Removes an attribute with the specified name.
+ *
+ * @param name attribute name.
+ * @return the removed attribute or null.
+ * @since 3.21
+ */
+ public AttributeInfo removeAttribute(String name) {
+ return AttributeInfo.remove(attributes, name);
+ }
+
+ /**
* Appends an attribute. If there is already an attribute with the same
* name, the new one substitutes for it.
*