net.sf.japaki.kit
Class SuperParserMold<T,B,V>

java.lang.Object
  extended by net.sf.japaki.kit.SuperParserMold<T,B,V>
Direct Known Subclasses:
CollectionParserMold, MapParserMold

public abstract class SuperParserMold<T,B,V>
extends Object

Parser mold for parsers that have subparses.


Constructor Summary
protected SuperParserMold(Class<T> targetType, Property<B,V> property, Factory<? extends T> factory)
          Constructs a generic parser mold from the given arguments.
 
Method Summary
protected  ParserMold<T> createMold(Parser<? super T> parser)
          Creates a new FixedParserMold from the specified parser and the underlying type and factory.
abstract  ParserMold<T> createMold(Parser<B> parser, Parser<Object> delParser)
          Creates a new parser mold.
protected  Factory<? extends T> getFactory()
          Returns the factory used to create new collections.
 Property<B,V> getProperty()
          Returns the property to create the sub parser
 Class<T> 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

SuperParserMold

protected SuperParserMold(Class<T> targetType,
                          Property<B,V> property,
                          Factory<? extends T> factory)
Constructs a generic parser mold from the given arguments.

Parameters:
targetType - the target type of the parsers created by this mold
property - the property to create the sub parser
factory - the factory used to create new collections
Throws:
NullPointerException - if any parameter is null.
Method Detail

getTargetType

public Class<T> getTargetType()
Returns the target type of the parsers created by this mold.

Returns:
the target type of the parsers created by this mold

getProperty

public Property<B,V> getProperty()
Returns the property to create the sub parser

Returns:
the property to create the sub parser

getFactory

protected Factory<? extends T> getFactory()
Returns the factory used to create new collections.

Returns:
the factory used to create new collections

createMold

protected ParserMold<T> createMold(Parser<? super T> parser)
Creates a new FixedParserMold from the specified parser and the underlying type and factory.

Parameters:
parser - fixed parser of the mold
Returns:
the new mold

createMold

public abstract ParserMold<T> createMold(Parser<B> parser,
                                         Parser<Object> delParser)
Creates a new parser mold.

Parameters:
parser - sub- or element parser
delParser - delimiter parser
Returns:
the new mold
Throws:
NullPointerException - if parser is null