public class PatternSanitizer
extends java.lang.Object
INVARIANTS:
Constructor and Description |
---|
PatternSanitizer(org.apache.log4j.Logger logger)
Creates an instance of the stateful sanitizer.
|
Modifier and Type | Method and Description |
---|---|
boolean |
admit(Pattern pattern)
Admits a new pattern, checking if it passes validation and name uniqueness checks.
|
boolean |
admit(Pattern pattern,
boolean skipPatternValidation)
Admits a new pattern, checking if it passes validation and name uniqueness checks.
|
void |
forgetPattern(Pattern pattern)
Forgets a pattern from the specification.
|
Pattern |
getAdmittedPatternByName(java.lang.String fqn) |
java.util.Set<Pattern> |
getAdmittedPatterns()
Returns the set of patterns that have been admitted so far.
|
java.util.Collection<PProblem> |
getProblemByPattern(Pattern pattern) |
java.util.Set<Pattern> |
getRejectedPatterns()
Returns the set of patterns that have been rejected so far.
|
public PatternSanitizer(org.apache.log4j.Logger logger)
logger
- where detected problems will be loggedpublic boolean admit(Pattern pattern)
pattern
- a pattern that should be validated.public boolean admit(Pattern pattern, boolean skipPatternValidation)
pattern
- a pattern that should be validated.skipPatternValidation
- if set to true, detailed pattern validation is skipped - true for model inferrer; not recommended for generic APIpublic java.util.Set<Pattern> getAdmittedPatterns()
public java.util.Set<Pattern> getRejectedPatterns()
public java.util.Collection<PProblem> getProblemByPattern(Pattern pattern)
public Pattern getAdmittedPatternByName(java.lang.String fqn)
fqn
- the fully qualified name of the patternpublic void forgetPattern(Pattern pattern)
Warning! Removing a pattern that has other patterns referring to it may leave the builder in an inconsistent state!
pattern
-