proguard
Class ClassSpecification

java.lang.Object
  extended by proguard.ClassSpecification
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
KeepClassSpecification

public class ClassSpecification
extends java.lang.Object
implements java.lang.Cloneable

This class stores a specification of classes and possibly class members. The specification is template-based: the class names and class member names and descriptors can contain wildcards. Classes can be specified explicitly, or as extensions or implementations in the class hierarchy.


Field Summary
 java.lang.String annotationType
           
 java.lang.String className
           
 java.lang.String comments
           
 java.lang.String extendsAnnotationType
           
 java.lang.String extendsClassName
           
 java.util.List fieldSpecifications
           
 java.util.List methodSpecifications
           
 int requiredSetAccessFlags
           
 int requiredUnsetAccessFlags
           
 
Constructor Summary
ClassSpecification()
          Creates a new ClassSpecification for all possible classes, without comments or class members.
ClassSpecification(ClassSpecification classSpecification)
          Creates a new ClassSpecification that is a copy of the given specification.
ClassSpecification(java.lang.String comments, int requiredSetAccessFlags, int requiredUnsetAccessFlags, java.lang.String annotationType, java.lang.String className, java.lang.String extendsAnnotationType, java.lang.String extendsClassName)
          Creates a new ClassSpecification for the specified class(es), without class members.
ClassSpecification(java.lang.String comments, int requiredSetAccessFlags, int requiredUnsetAccessFlags, java.lang.String annotationType, java.lang.String className, java.lang.String extendsAnnotationType, java.lang.String extendsClassName, java.util.List fieldSpecifications, java.util.List methodSpecifications)
          Creates a new ClassSpecification for the specified classes and class members.
 
Method Summary
 void addField(MemberSpecification fieldSpecification)
          Specifies to keep the specified field(s) of this option's class(es).
 void addMethod(MemberSpecification methodSpecification)
          Specifies to keep the specified method(s) of this option's class(es).
 java.lang.Object clone()
           
 boolean equals(java.lang.Object object)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comments

public final java.lang.String comments

requiredSetAccessFlags

public int requiredSetAccessFlags

requiredUnsetAccessFlags

public int requiredUnsetAccessFlags

annotationType

public final java.lang.String annotationType

className

public java.lang.String className

extendsAnnotationType

public final java.lang.String extendsAnnotationType

extendsClassName

public final java.lang.String extendsClassName

fieldSpecifications

public java.util.List fieldSpecifications

methodSpecifications

public java.util.List methodSpecifications
Constructor Detail

ClassSpecification

public ClassSpecification()
Creates a new ClassSpecification for all possible classes, without comments or class members.


ClassSpecification

public ClassSpecification(ClassSpecification classSpecification)
Creates a new ClassSpecification that is a copy of the given specification.


ClassSpecification

public ClassSpecification(java.lang.String comments,
                          int requiredSetAccessFlags,
                          int requiredUnsetAccessFlags,
                          java.lang.String annotationType,
                          java.lang.String className,
                          java.lang.String extendsAnnotationType,
                          java.lang.String extendsClassName)
Creates a new ClassSpecification for the specified class(es), without class members.

Parameters:
comments - provides optional comments on this specification.
requiredSetAccessFlags - the class access flags that must be set in order for the class to apply.
requiredUnsetAccessFlags - the class access flags that must be unset in order for the class to apply.
annotationType - the name of the class that must be an annotation of the class in order for it to apply. The name may be null to specify that no annotation is required.
className - the class name. The name may be null to specify any class, or it may contain "**", "*", or "?" wildcards.
extendsAnnotationType - the name of the class of that must be an annotation of the class that the class must extend or implement in order to apply. The name may be null to specify that no annotation is required.
extendsClassName - the name of the class that the class must extend or implement in order to apply. The name may be null to specify any class.

ClassSpecification

public ClassSpecification(java.lang.String comments,
                          int requiredSetAccessFlags,
                          int requiredUnsetAccessFlags,
                          java.lang.String annotationType,
                          java.lang.String className,
                          java.lang.String extendsAnnotationType,
                          java.lang.String extendsClassName,
                          java.util.List fieldSpecifications,
                          java.util.List methodSpecifications)
Creates a new ClassSpecification for the specified classes and class members.

Parameters:
comments - provides optional comments on this specification.
requiredSetAccessFlags - the class access flags that must be set in order for the class to apply.
requiredUnsetAccessFlags - the class access flags that must be unset in order for the class to apply.
annotationType - the name of the class that must be an annotation of the class in order for it to apply. The name may be null to specify that no annotation is required.
className - the class name. The name may be null to specify any class, or it may contain "**", "*", or "?" wildcards.
extendsAnnotationType - the name of the class of that must be an annotation of the class that the class must extend or implement in order to apply. The name may be null to specify that no annotation is required.
extendsClassName - the name of the class that the class must extend or implement in order to apply. The name may be null to specify any class.
fieldSpecifications - the field specifications.
methodSpecifications - the method specifications.
Method Detail

addField

public void addField(MemberSpecification fieldSpecification)
Specifies to keep the specified field(s) of this option's class(es).

Parameters:
fieldSpecification - the field specification.

addMethod

public void addMethod(MemberSpecification methodSpecification)
Specifies to keep the specified method(s) of this option's class(es).

Parameters:
methodSpecification - the method specification.

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object