Class SimplePatternSearcher
- java.lang.Object
-
- com.inductiveautomation.ignition.common.util.SimplePatternSearcher
-
- All Implemented Interfaces:
PatternSearcher
public class SimplePatternSearcher extends java.lang.Object implements PatternSearcher
This class helps with "simple" pattern matching. That is, it will take a pattern and apply stars (*) and question marks (?) to mean match any, and match one respectively.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.inductiveautomation.ignition.common.util.PatternSearcher
PatternSearcher.SubstringLocation
-
-
Constructor Summary
Constructors Constructor Description SimplePatternSearcher(java.lang.String pattern)
SimplePatternSearcher(java.lang.String pattern, boolean matchLine)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description PatternSearcher.SubstringLocation[]
find(java.lang.CharSequence input)
java.util.regex.Pattern
getPattern()
boolean
matches(java.lang.CharSequence input)
static boolean
matches(java.lang.String pattern, java.lang.CharSequence input)
void
setPattern(java.lang.String pattern)
void
setPattern(java.lang.String pattern, boolean matchLine)
-
-
-
Method Detail
-
setPattern
public void setPattern(java.lang.String pattern)
-
setPattern
public void setPattern(java.lang.String pattern, boolean matchLine)
- Parameters:
pattern
- The pattern string to use. If null or blank, any string will match successfully.matchLine
- If true, the pattern will be applied to the whole string. If false, the pattern will get "*" appended to the front and back so that it matches mid-line.
-
getPattern
public java.util.regex.Pattern getPattern()
-
matches
public boolean matches(java.lang.CharSequence input)
- Specified by:
matches
in interfacePatternSearcher
-
find
@Nullable public PatternSearcher.SubstringLocation[] find(java.lang.CharSequence input)
- Specified by:
find
in interfacePatternSearcher
-
matches
public static boolean matches(java.lang.String pattern, java.lang.CharSequence input)
-
-