Package de.unkrig.ref4j
Class PatternFactory
java.lang.Object
de.unkrig.ref4j.PatternFactory
- Direct Known Subclasses:
PatternFactory
A facade or abstraction for various regular expression frameworks.
To get
ServiceLoader<PatternFactory> patternFactory = ServiceLoader.load(PatternFactory.class);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCompiles the given regex into aPattern.abstract PatternCompiles the given regex into aPatternwith the given flags.static PatternFactoryget()Returns the pattern factory configured in this JVM.static PatternFactoryabstract StringgetId()abstract intabstract booleanmatches(String regex, CharSequence input)
-
Constructor Details
-
PatternFactory
public PatternFactory()
-
-
Method Details
-
get
Returns the pattern factory configured in this JVM.- The class named by the system property "de.unkrig.ref4j.PatternFactory" (if the system property is set and the class is registered as a pattern factory)
- The first of all registered pattern factories on the classpath (if any)
-
The
java.util.regexpattern factory
- See Also:
-
EnhancedServiceLoader.load(Class)
-
getId
- Returns:
- A package name-like string that is unique among all existing pattern factory implementations
-
get
- Returns:
- The class that has the given name and extends the
PatternFactoryclass
-
getSupportedFlags
public abstract int getSupportedFlags()- Returns:
- The union of all flags supported by
thisengine.
-
compile
Compiles the given regex into aPattern.- Throws:
PatternSyntaxException
-
compile
Compiles the given regex into aPatternwith the given flags.- Parameters:
flags- The or'ed compilation flag constants declared byPattern- Throws:
IllegalArgumentException- A flag was given that is not set ingetSupportedFlags()PatternSyntaxException- See Also:
-
matches
- See Also:
-
quote
- See Also:
-
quoteReplacement
- See Also:
-