|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.japaki.text.AbstractParser<Collection<E>>
net.sf.japaki.text.CollectionParser<E>
public class CollectionParser<E>
Parser for collections.
Constructor Summary | |
---|---|
protected |
CollectionParser(Parser<SinglePropertyBean<E>> parser,
Parser<Object> delimiterParser)
Creates a new collection parser based on the specified parser. |
Method Summary | ||
---|---|---|
static
|
newParser(Parser<? super E> parser,
Factory<? extends E> factory,
Parser<Object> delimiterParser)
Creates a new collection parser based on the specified parser. |
|
static
|
newParser(Parser<? super E> parser,
Factory<? extends E> factory,
String delimiter)
Creates a new collection parser based on the specified parser. |
|
static
|
newParser(Parser<SinglePropertyBean<E>> parser,
Parser<Object> delimiterParser)
Creates a new collection parser based on the specified parser. |
|
protected void |
parseIt(ParseReader in,
Collection<E> target)
Parses text starting at the specified position. |
|
String |
treeView()
Returns a tree view of this parser. |
|
protected void |
writeIt(ParseWriter out,
Collection<E> source)
Formats the source object and writes it into the output stream |
Methods inherited from class net.sf.japaki.text.AbstractParser |
---|
getLogger, handleException, parse, toString, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected CollectionParser(Parser<SinglePropertyBean<E>> parser, Parser<Object> delimiterParser)
parser
- element parserdelimiterParser
- parser for tokens between elements
NullPointerException
- if parser
is null
Method Detail |
---|
public static <E> Parser<Collection<E>> newParser(Parser<SinglePropertyBean<E>> parser, Parser<Object> delimiterParser)
parser
- element parserdelimiterParser
- parser for tokens between elements
NullPointerException
- if parser
is null
public static <E> Parser<Collection<E>> newParser(Parser<? super E> parser, Factory<? extends E> factory, Parser<Object> delimiterParser)
parser
- element parserfactory
- used to create a new element if it does not exist yetdelimiterParser
- parser for tokens between elements
NullPointerException
- if parser
or factory
is null
public static <E> Parser<Collection<E>> newParser(Parser<? super E> parser, Factory<? extends E> factory, String delimiter)
parser
- element parserfactory
- used to create a new element if it does not exist yetdelimiter
- a constant expected and formatted between collection
elements
NullPointerException
- if any parameter is null
protected void parseIt(ParseReader in, Collection<E> target) throws IOException
AbstractParser
parseIt
in class AbstractParser<Collection<E>>
in
- the position where to start parsingtarget
- place where the parsed object is stored.
NullPointerException
- if in
or target
or one of its (sub-) properties is null
and the parser cannot handle it
BeanStoreException
- if the parsed value could not be stored
IOException
- if an I/O error occursprotected void writeIt(ParseWriter out, Collection<E> source) throws IOException, FormatException
AbstractParser
writeIt
in class AbstractParser<Collection<E>>
out
- the stream and position where to put the formatted text.source
- source object
NullPointerException
- if out
is null
IOException
- if an I/O error occurs
FormatException
- if the source object can not be formatted with
this parser.public String treeView()
Parser
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |