org.apache.wicket.util.parse.metapattern.parsers
Class MetaPatternParser

java.lang.Object
  extended by 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
MetaPatternParser(CharSequence input)
          Construct the parser.
MetaPatternParser(MetaPattern pattern, CharSequence input)
          Construct the parser and initialize the matcher with the pattern given.
 
Method Summary
protected  boolean advance(MetaPattern pattern)
          Advance parsing to the next element.
 boolean atEnd()
          Whether the internal cursor has advanced to the end of the input.
 Matcher matcher()
          Gets the matcher.
 boolean matches()
          Whether the matcher matches the pattern.
 void setPattern(MetaPattern pattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 pattern
input - 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

matcher

public final Matcher matcher()
Gets the matcher.

Returns:
the matcher

atEnd

public final boolean atEnd()
Whether the internal cursor has advanced to the end of the input.

Returns:
whether the input is parsed


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.