Package randoop.reflection
Class OmitMethodsPredicate
java.lang.Object
randoop.reflection.OmitMethodsPredicate
Tests whether the
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.
-
Field Summary
Modifier and TypeFieldDescriptionprivate static boolean
Set to true to produce voluminous debugging regarding omission.static final OmitMethodsPredicate
An OmitMethodsPredicate that does no omission.Pattern
s to match operations that should be omitted. -
Constructor Summary
ConstructorDescriptionOmitMethodsPredicate
(List<Pattern> omitPatterns) Create a new OmitMethodsPredicate. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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 theRawSignature
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.toString()
-
Field Details
-
logOmit
private static boolean logOmitSet to true to produce voluminous debugging regarding omission. -
NO_OMISSION
An OmitMethodsPredicate that does no omission. -
omitPatterns
Pattern
s to match operations that should be omitted. Never side-effected.
-
-
Constructor Details
-
OmitMethodsPredicate
Create a new OmitMethodsPredicate.- Parameters:
omitPatterns
- a list of regular expressions for method signatures. May be empty.
-
-
Method Details
-
shouldOmit
Indicates whether an omit pattern matches the raw signature of the method, either in the declaring class of the method or in a supertype.- Parameters:
operation
- the operation for the method or constructor- Returns:
- true if an omit pattern matches the signature of the method or constructor in the current class (or, for a method, a superclass that defines the method)
-
shouldOmitConstructor
Indicates whether an omit pattern matches the raw signature of the constructor.- Parameters:
operation
- the operation for the method- Returns:
- true if the signature of the constructor is matched by an omit pattern, false otherwise
-
shouldOmitMethod
Indicates whether an omit pattern matches the raw signature of the method in either the declaring class of the method or a supertype.- Parameters:
operation
- the operation for the method- Returns:
- true if the signature of the method in the current class or a superclass is matched by an omit pattern, false otherwise
-
shouldOmitExact
Returns true if the operation is a constructor or method call and some omit pattern matches theRawSignature
of the operation, in the operation's class.This method does not check for matches of overridden definitions of the operation in superclasses.
- Parameters:
operation
- the operation to be matched against the omit patterns of this predicate- Returns:
- true if the signature matches an omit pattern, and false otherwise
-
toString
-