net.sf.japaki.kit
Class RegexParserMold
java.lang.Object
net.sf.japaki.kit.LeafParserMold<String>
net.sf.japaki.kit.RegexParserMold
- All Implemented Interfaces:
- ParserMold<String>
public class RegexParserMold
- extends LeafParserMold<String>
Parser mold based on a RegexFormat
.
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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.
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