|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.japaki.text.AbstractParser<Map<K,V>>
net.sf.japaki.text.MapParser<K,V>
public class MapParser<K,V>
Parses a map, where the key of each field is given in the input stream.
| Constructor Summary | |
|---|---|
protected |
MapParser(Parser<? super KeyValueBean<K,V>> keyParser,
Parser<? super KeyValueBean<K,V>> valueParser,
Parser<?> delimiterParser)
Creates a new map parser from the specified parameters. |
| Method Summary | ||
|---|---|---|
static
|
newParser(Parser<? super KeyValueBean<K,V>> parser,
Parser<?> delimiterParser)
Creates a new map parser from the specified parameters. |
|
static
|
newParser(Parser<? super KeyValueBean<K,V>> keyParser,
Parser<? super KeyValueBean<K,V>> valueParser,
Parser<?> delimiterParser)
Creates a new map parser from the specified parameters. |
|
static
|
newParser(Parser<? super KeyValueBean<K,V>> parser,
String delimiter)
Creates a new map parser from the specified parameters. |
|
protected void |
parseIt(ParseReader in,
Map<K,V> target)
Parses text starting at the specified position. |
|
String |
treeView()
Returns a tree view of this parser. |
|
protected void |
writeIt(ParseWriter out,
Map<K,V> 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 MapParser(Parser<? super KeyValueBean<K,V>> keyParser,
Parser<? super KeyValueBean<K,V>> valueParser,
Parser<?> delimiterParser)
keyParser - parser for parsing the keyvalueParser - element parserdelimiterParser - parser for tokens between map entries
NullPointerException - if keyParser or valueParser
is null| Method Detail |
|---|
public static <K,V> Parser<Map<K,V>> newParser(Parser<? super KeyValueBean<K,V>> keyParser,
Parser<? super KeyValueBean<K,V>> valueParser,
Parser<?> delimiterParser)
keyParser - parser for parsing the indexvalueParser - element parserdelimiterParser - parser for tokens between map entries
NullPointerException - if keyParser or valueParser
is null
public static <K,V> Parser<Map<K,V>> newParser(Parser<? super KeyValueBean<K,V>> parser,
Parser<?> delimiterParser)
parser - entry parserdelimiterParser - parser for tokens between map entries
NullPointerException - if parser is null
public static <K,V> Parser<Map<K,V>> newParser(Parser<? super KeyValueBean<K,V>> parser,
String delimiter)
parser - entry parserdelimiter - a constant expected and formatted between map entries
protected void parseIt(ParseReader in,
Map<K,V> target)
throws IOException,
ParseException
AbstractParser
parseIt in class AbstractParser<Map<K,V>>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 occurs
ParseException - if the beginning of the string in in
cannot be parsed
protected void writeIt(ParseWriter out,
Map<K,V> source)
throws IOException,
FormatException
AbstractParser
writeIt in class AbstractParser<Map<K,V>>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 | ||||||||