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

java.lang.Object
  extended by org.apache.wicket.util.parse.metapattern.parsers.MetaPatternParser
      extended by org.apache.wicket.util.parse.metapattern.parsers.ListParser
Direct Known Subclasses:
CommaSeparatedVariableParser

public class ListParser
extends MetaPatternParser

Parses an arbitrary list format with a pattern for list entries and a pattern for list separators.

Author:
Jonathan Locke

Constructor Summary
ListParser(MetaPattern entryPattern, MetaPattern separatorPattern, java.lang.CharSequence input)
          Constructs a list parser from an entry MetaPattern, a separator MetaPattern and an input character sequence.
 
Method Summary
 java.util.List getValues()
          Gets the parsed values.
 boolean matches()
          Parse the input and add the elements to an internal list to be accessed by
 
Methods inherited from class org.apache.wicket.util.parse.metapattern.parsers.MetaPatternParser
advance, atEnd, matcher, setPattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListParser

public ListParser(MetaPattern entryPattern,
                  MetaPattern separatorPattern,
                  java.lang.CharSequence input)
Constructs a list parser from an entry MetaPattern, a separator MetaPattern and an input character sequence.

Parameters:
entryPattern - The pattern in between the separators
separatorPattern - The separator pattern
input - The input to parse
Method Detail

matches

public final boolean matches()
Parse the input and add the elements to an internal list to be accessed by

Overrides:
matches in class MetaPatternParser
Returns:
whether the matcher matches
See Also:
getValues(), MetaPatternParser.matches()

getValues

public final java.util.List getValues()
Gets the parsed values. It depends on the elements pattern, whether empty elements, double or single quotes or escape characters are supported.

Returns:
the parsed values


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