public class OmitMethodsPredicate
extends java.lang.Object
RawSignature
of an operation is matched by an omit. If so, the
operation should be omitted from the operation set.
A pattern matches an operation representing a constructor, if the pattern matches the RawSignature
of the operation. A pattern matches an operation representing a method, if the
pattern matches the RawSignature
of an operation for which the declaring class is a
supertype of TypedClassOperation.getDeclaringType()
of the operation. * A constructor may
If the operation is a method, a pattern matches the operation if This class provides methods that
(1) test the raw signature of an operation, and (2) test the raw signature of an operation and,
for an inherited method, that of the same operation in superclasses.
Modifier and Type | Field and Description |
---|---|
private static boolean |
logOmit
Set to true to produce voluminous debugging regarding omission.
|
static OmitMethodsPredicate |
NO_OMISSION
An OmitMethodsPredicate that does no omission.
|
private java.util.List<java.util.regex.Pattern> |
omitPatterns
Pattern s to match operations that should be omitted. |
Constructor and Description |
---|
OmitMethodsPredicate(java.util.List<java.util.regex.Pattern> omitPatterns)
Create a new OmitMethodsPredicate.
|
Modifier and Type | Method and Description |
---|---|
boolean |
shouldOmit(TypedClassOperation operation)
Indicates whether an omit pattern matches the raw signature of the method, either in the
declaring class of the method or in a supertype.
|
private boolean |
shouldOmitConstructor(TypedClassOperation operation)
Indicates whether an omit pattern matches the raw signature of the constructor.
|
private boolean |
shouldOmitExact(TypedClassOperation operation)
Returns true if the operation is a constructor or method call and some omit pattern matches the
RawSignature of the operation, in the operation's class. |
private boolean |
shouldOmitMethod(TypedClassOperation operation)
Indicates whether an omit pattern matches the raw signature of the method in either the
declaring class of the method or a supertype.
|
java.lang.String |
toString() |
private static boolean logOmit
public static final OmitMethodsPredicate NO_OMISSION
private final java.util.List<java.util.regex.Pattern> omitPatterns
Pattern
s to match operations that should be omitted. Never side-effected.public OmitMethodsPredicate(java.util.List<java.util.regex.Pattern> omitPatterns)
omitPatterns
- a list of regular expressions for method signatures. May be empty.public boolean shouldOmit(TypedClassOperation operation)
operation
- the operation for the method or constructorprivate boolean shouldOmitConstructor(TypedClassOperation operation)
operation
- the operation for the methodprivate boolean shouldOmitMethod(TypedClassOperation operation)
operation
- the operation for the methodprivate boolean shouldOmitExact(TypedClassOperation operation)
RawSignature
of the operation, in the operation's class.
This method does not check for matches of overridden definitions of the operation in superclasses.
operation
- the operation to be matched against the omit patterns of this predicatepublic java.lang.String toString()
toString
in class java.lang.Object