Class MetaPatternParser
- java.lang.Object
-
- org.apache.wicket.util.parse.metapattern.parsers.MetaPatternParser
-
- Direct Known Subclasses:
IntegerVariableAssignmentParser,ListParser,TagNameParser,VariableAssignmentParser,WordParser
public abstract class MetaPatternParser extends Object
Base class for various MetaPattern based parsers.- Author:
- Jonathan Locke
-
-
Constructor Summary
Constructors Constructor Description MetaPatternParser(CharSequence input)Construct the parser.MetaPatternParser(MetaPattern pattern, CharSequence input)Construct the parser and initialize the matcher with the pattern given.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanadvance(MetaPattern pattern)Advance parsing to the next element.booleanatEnd()Whether the internal cursor has advanced to the end of the input.Matchermatcher()Gets the matcher.booleanmatches()Whether the matcher matches the pattern.voidsetPattern(MetaPattern pattern)
-
-
-
Constructor Detail
-
MetaPatternParser
public MetaPatternParser(CharSequence input)
Construct the parser. You must call- Parameters:
input- to parse- See Also:
to initialize the matcher with the pattern.
-
MetaPatternParser
public MetaPatternParser(MetaPattern pattern, CharSequence input)
Construct the parser and initialize the matcher with the pattern given.- Parameters:
pattern- Meta patterninput- Input to parse
-
-
Method Detail
-
setPattern
public void setPattern(MetaPattern pattern)
- Parameters:
pattern- Pattern
-
advance
protected final boolean advance(MetaPattern pattern)
Advance parsing to the next element. The internal cursor will be moved to end of the string matched.- Parameters:
pattern- Meta pattern- Returns:
- True if found, false otherwise
-
matches
public boolean matches()
Whether the matcher matches the pattern.- Returns:
- whether the matcher matches
-
atEnd
public final boolean atEnd()
Whether the internal cursor has advanced to the end of the input.- Returns:
- whether the input is parsed
-
-