public class DefaultParser extends Object
This parser takes text input from a java.io.Reader
and writes text output to a java.io.Writer
.
Constructor and Description |
---|
DefaultParser(Reader in,
Writer out)
Creates and initializes a new Parser.
|
Modifier and Type | Method and Description |
---|---|
void |
perform(DataFieldResolver dataFieldResolver)
Starts the parsing procedure.
|
String |
perform(Writer out,
String[] endMarkers,
int[] arrayPositioner,
DataFieldResolver dataFieldResolver)
Parses the input string.
|
public void perform(DataFieldResolver dataFieldResolver) throws IOException
IOException
DefaultParser#perform(Writer, String[], int[])
public String perform(Writer out, String[] endMarkers, int[] arrayPositioner, DataFieldResolver dataFieldResolver) throws IOException
DataFields are resolved using this parser's dataFieldResolver, keyword
resolution is delegated to a KeywordResolver
. The input that
is not withing a tag (keyword or datafield) is written directly to
out
unless it is consumed by a KeywordResolver
.
NOTE: For the initial start of the parsing use perform()
The arrayPositioner holds the postions to be used for resolving
multi-dimensional fields. E.g. in a loop construct
arrayPositioner[0]
will hold the iteration (starting from 0)
of the outer most loop, arrayPositioner[1]
holds the iteration
of the first inner loop.
out
- the current output reader.endMarkers
- the currently expected endMarkers.arrayPositioner
- the current arrayPositioner.IOException
resolve(String, Reader, Writer, DataFieldResolver, String[], int[])
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.