|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.japaki.kit.LeafParserMold<V>
public abstract class LeafParserMold<V>
Skeleton class for molds that create leaf parsers.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.sf.japaki.kit.ParserMold |
---|
ParserMold.Parameter |
Constructor Summary | |
---|---|
protected |
LeafParserMold(Class<V> targetType,
Format defaultFormat)
Creates a new LeafParser mold. |
Method Summary | ||
---|---|---|
protected String |
getErrorMessage(Property property,
String pattern)
Returns the error message of the parser to be created. |
|
protected Format |
getFormat()
Returns the format used, if no pattern is specified. |
|
protected abstract Format |
getFormat(String pattern)
Returns the format of the parser to be created. |
|
protected String |
getName(Property property)
Returns the name of the parser to be created. |
|
|
getParser(Property<B,V> property,
ParserMold.Parameter parameter)
Creates a parser for the specified property and pattern. |
|
Class<V> |
getTargetType()
Returns the target type of the parsers created by this mold. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LeafParserMold(Class<V> targetType, Format defaultFormat)
targetType
- the target type of the parsers created by this molddefaultFormat
- the format used when no pattern is specified.
The default format may be null
, then a pattern is required.
NullPointerException
- if targetType is null
.Method Detail |
---|
protected String getErrorMessage(Property property, String pattern)
property
- property of the new parserpattern
- pattern of the new parsers
NullPointerException
- if property is null
protected String getName(Property property)
property
- property of the new parser
NullPointerException
- if property is null
protected Format getFormat()
NullPointerException
- if the default format is not specifiedprotected abstract Format getFormat(String pattern)
pattern
- the pattern describing the format
NullPointerException
- if the given pattern is null
IllegalArgumentException
- if the given pattern is invalidpublic <B> Parser<B> getParser(Property<B,V> property, ParserMold.Parameter parameter)
ParserMold
getParser
in interface ParserMold<V>
parameter
- pattern
- the pattern string for the formatproperty
- property of the created parser
NullPointerException
- if parameter is null
or
if property or pattern is null
and this mold does not allow it.
IllegalArgumentException
- if the pattern cannot be interpreted
by this mold.public Class<V> getTargetType()
ParserMold
getTargetType
in interface ParserMold<V>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |