|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.japaki.text.AbstractParser<T>
public abstract class AbstractParser<T>
Parser skeleton that creates a path of the traversed parsers for logging
purposes.
Instead of parse and write,
parseIt and writeIt must be implemented.
| Constructor Summary | |
|---|---|
protected |
AbstractParser(String name)
Creates a new abstract parser. |
| Method Summary | ||
|---|---|---|
protected Logger |
getLogger()
|
|
protected static
|
handleException(RuntimeException e,
Property<B,V> property,
B bean,
V value)
Handles exceptions that are thrown during a setValue operation. |
|
void |
parse(ParseReader in,
T target)
Parses text starting at the specified position. |
|
protected abstract void |
parseIt(ParseReader in,
T target)
Parses text starting at the specified position. |
|
String |
toString()
|
|
void |
write(ParseWriter out,
T source)
Formats the source object and writes it into the output stream |
|
protected abstract void |
writeIt(ParseWriter out,
T source)
Formats the source object and writes it into the output stream |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.japaki.text.Parser |
|---|
treeView |
| Constructor Detail |
|---|
protected AbstractParser(String name)
name - the name is returned in the toString() method.
NullPointerException - if name is null| Method Detail |
|---|
protected Logger getLogger()
protected static <B,V> void handleException(RuntimeException e,
Property<B,V> property,
B bean,
V value)
setValue operation.
e - exception that has occurredproperty - See Property.setValue()bean - See Property.setValue()value - See Property.setValue()
BeanStoreException - if a defined exception has occurred
RuntimeException - if an undefined exception has occurred
protected abstract void parseIt(ParseReader in,
T target)
throws IOException,
ParseException
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 abstract void writeIt(ParseWriter out,
T source)
throws IOException,
FormatException
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 void parse(ParseReader in,
T target)
throws IOException,
ParseException
Parser
parse in interface Parser<T>in - the position where to start parsingtarget - place where the parsed object is stored.
ClassCastException - if generics rules are violated
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
public void write(ParseWriter out,
T source)
throws IOException,
FormatException
Parser
write in interface Parser<T>out - the stream and position where to put the formatted text.source - source object
ClassCastException - if generics rules are violated
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 toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||