diff options
Diffstat (limited to 'src/main/javassist/bytecode/ClassFile.java')
-rw-r--r-- | src/main/javassist/bytecode/ClassFile.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/ClassFile.java b/src/main/javassist/bytecode/ClassFile.java index 9e7729fd..e48b8e04 100644 --- a/src/main/javassist/bytecode/ClassFile.java +++ b/src/main/javassist/bytecode/ClassFile.java @@ -771,6 +771,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() @@ -788,6 +793,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. * |