Module org.apache.wicket.util
Class MetaPatternParser
java.lang.Object
org.apache.wicket.util.parse.metapattern.parsers.MetaPatternParser
- Direct Known Subclasses:
IntegerVariableAssignmentParser
,ListParser
,TagNameParser
,VariableAssignmentParser
,WordParser
Base class for various MetaPattern based parsers.
- Author:
- Jonathan Locke
-
Constructor Summary
ConstructorDescriptionMetaPatternParser
(CharSequence input) Construct the parser.MetaPatternParser
(MetaPattern pattern, CharSequence input) Construct the parser and initialize the matcher with the pattern given. -
Method Summary
Modifier and TypeMethodDescriptionprotected final boolean
advance
(MetaPattern pattern) Advance parsing to the next element.final boolean
atEnd()
Whether the internal cursor has advanced to the end of the input.final Matcher
matcher()
Gets the matcher.boolean
matches()
Whether the matcher matches the pattern.void
setPattern
(MetaPattern pattern)
-
Constructor Details
-
MetaPatternParser
Construct the parser. You must call- Parameters:
input
- to parse- See Also:
-
MetaPatternParser
Construct the parser and initialize the matcher with the pattern given.- Parameters:
pattern
- Meta patterninput
- Input to parse
-
-
Method Details
-
setPattern
- Parameters:
pattern
- Pattern
-
advance
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
Whether the matcher matches the pattern.- Returns:
- whether the matcher matches
-
matcher
Gets the matcher.- Returns:
- the matcher
-
atEnd
Whether the internal cursor has advanced to the end of the input.- Returns:
- whether the input is parsed
-