net.sf.japaki.kit
Class RegexParserMold

java.lang.Object
  extended by net.sf.japaki.kit.LeafParserMold<String>
      extended by net.sf.japaki.kit.RegexParserMold
All Implemented Interfaces:
ParserMold<String>

public class RegexParserMold
extends LeafParserMold<String>

Parser mold based on a RegexFormat.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.japaki.kit.ParserMold
ParserMold.Parameter
 
Constructor Summary
protected RegexParserMold()
          Creates a new regex parser mold.
  RegexParserMold(String delimiter, String regex)
          Creates a new regex parser mold.
 
Method Summary
protected  Format getFormat(String delimiter)
          Creates a new regex format with the specified delimiter and the underlying regular expression.
static RegexParserMold getInstance()
          Returns the default instance of this class.
 
Methods inherited from class net.sf.japaki.kit.LeafParserMold
getErrorMessage, getFormat, getName, getParser, getTargetType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexParserMold

public RegexParserMold(String delimiter,
                       String regex)
Creates a new regex parser mold.

Parameters:
delimiter - default delimiter for new formats. If the default delimiter is null, it must be specified in getParser.
regex - see RegexFormat

RegexParserMold

protected RegexParserMold()
Creates a new regex parser mold.

Method Detail

getInstance

public static final RegexParserMold getInstance()
Returns the default instance of this class.

Returns:
the default instance of this class

getFormat

protected Format getFormat(String delimiter)
Creates a new regex format with the specified delimiter and the underlying regular expression.

Specified by:
getFormat in class LeafParserMold<String>
Parameters:
delimiter - see RegexFormat
Returns:
format of the parser to be created
Throws:
NullPointerException - if the given delimiter is null