diff options
Diffstat (limited to 'src/proguard/classfile/attribute/visitor/AttributeNameFilter.java')
-rw-r--r-- | src/proguard/classfile/attribute/visitor/AttributeNameFilter.java | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java b/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java index aa81ce0..9906483 100644 --- a/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java +++ b/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java @@ -2,7 +2,7 @@ * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * - * Copyright (c) 2002-2009 Eric Lafortune (eric@graphics.cornell.edu) + * Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -24,7 +24,7 @@ import proguard.classfile.*; import proguard.classfile.attribute.*; import proguard.classfile.attribute.annotation.*; import proguard.classfile.attribute.preverification.*; -import proguard.util.StringMatcher; +import proguard.util.*; /** * This AttributeVisitor delegates its visits another AttributeVisitor, but @@ -41,7 +41,21 @@ implements AttributeVisitor /** - * Creates a new AttributeNameFilter. + * Creates a new AttributeNameFilter based on a given name. + * @param name the string matcher that will check the attribute + * names. + * @param attributeVisitor the <code>AttributeVisitor</code> to which + * visits will be delegated. + */ + public AttributeNameFilter(String name, + AttributeVisitor attributeVisitor) + { + this(new FixedStringMatcher(name), attributeVisitor); + } + + + /** + * Creates a new AttributeNameFilter based on a given string matcher. * @param stringMatcher the string matcher that will check the attribute * names. * @param attributeVisitor the <code>AttributeVisitor</code> to which @@ -66,6 +80,15 @@ implements AttributeVisitor } + public void visitBootstrapMethodsAttribute(Clazz clazz, BootstrapMethodsAttribute bootstrapMethodsAttribute) + { + if (accepted(clazz, bootstrapMethodsAttribute)) + { + bootstrapMethodsAttribute.accept(clazz, attributeVisitor); + } + } + + public void visitSourceFileAttribute(Clazz clazz, SourceFileAttribute sourceFileAttribute) { if (accepted(clazz, sourceFileAttribute)) |