|
Structured Text Toolkit | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.saelist.stx.parser.LstxParser
Parses a text that is structured by indentation.
Each level of indentation must be exactly two spaces. The only significant characters are leading spaces and new-lines. Other characters don't influence the parsing at all. However, a warning is logged if the ends with a tab. Any escaping, trimming and so on must be done on the resulting Pair hierarchy. That is what @{link com.saelist.stx.operator.Operator}s are for.
| Field Summary | |
static Logger |
logger
|
| Constructor Summary | |
LstxParser()
|
|
| Method Summary | |
static void |
applyBasicProfile(Pair pair)
Split on '=' and remove comments. |
static Pair |
parse(java.io.File file)
Parses the text from file into a structure of @link{com.saelist.stx.Pair}s
based on the indentation of the text. |
static Pair |
parse(java.io.Reader in)
Parses the text from in into a structure of @link{com.saelist.stx.Pair}s
based on the indentation of the text. |
static Pair |
parse(java.lang.String text)
Parses text into a structure of @link{com.saelist.stx.Pair}s
based on the indentation of the text. |
static void |
unParse(java.io.Writer out,
Pair pair)
Writer the pair to out. |
static void |
unParse(java.io.Writer out,
Pair pair,
boolean join)
Writes the pair to out, joining single children
on the parents' line after a "=". |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static Logger logger
| Constructor Detail |
public LstxParser()
| Method Detail |
public static Pair parse(java.lang.String text)
text into a structure of @link{com.saelist.stx.Pair}s
based on the indentation of the text.
text - to be parsed.
public static Pair parse(java.io.File file)
throws java.io.IOException
file into a structure of @link{com.saelist.stx.Pair}s
based on the indentation of the text.
file - contains text to be parsed.
java.io.IOException
public static Pair parse(java.io.Reader in)
throws java.io.IOException
in into a structure of @link{com.saelist.stx.Pair}s
based on the indentation of the text.
in - provides the text to be parsed.
java.io.IOException
public static void unParse(java.io.Writer out,
Pair pair)
throws java.io.IOException
pair to out.
out - receives the result.pair - to be written.
java.io.IOException - on problems with out.
public static void unParse(java.io.Writer out,
Pair pair,
boolean join)
throws java.io.IOException
pair to out, joining single children
on the parents' line after a "=".
out - receives the result.pair - to be written.join - weather to append the text of single children (with no
siblings or children of their own) to their parents' line after a "=".
java.io.IOException - on problems with out.public static void applyBasicProfile(Pair pair)
|
Structured Text Toolkit | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||