public class StructuredTextParser extends Object
StructuredTextRecord
for a brief description of
the structured text format.Modifier and Type | Field and Description |
---|---|
static Charset |
DEFAULT_CHARSET |
Constructor and Description |
---|
StructuredTextParser() |
Modifier and Type | Method and Description |
---|---|
StructuredTextRecord |
parse(InputStream is)
Parse structured text from an
InputStream and
return the resulting data. |
StructuredTextRecord |
parse(InputStream is,
Charset charset)
Parse structured text from an
InputStream and
return the resulting data. |
StructuredTextRecord |
parse(String text)
Parse structured text from a
String and
return the resulting data. |
void |
setRaiseExceptionOnParseError(boolean raiseExceptionOnParseError)
By default, if unexpected structure is encountered while parsing
structured text, the parser will raise a
StructuredTextParseException . |
public static final Charset DEFAULT_CHARSET
public void setRaiseExceptionOnParseError(boolean raiseExceptionOnParseError)
StructuredTextParseException
.
In some cases the structured text already parsed will have yielded useful data.
Setting this flag to true
will allow the parser to fail silently
and return as much of the data as it has been able to extract.raiseExceptionOnParseError
- set to true to ignore structure errorspublic StructuredTextRecord parse(InputStream is)
InputStream
and
return the resulting data. The default character set
(Windows 1252) is used.is
- InputStream
instanceStructuredTextRecord
instancepublic StructuredTextRecord parse(InputStream is, Charset charset)
InputStream
and
return the resulting data. The caller supplies the
character set to be used.is
- InputStream
instancecharset
- character set to useStructuredTextRecord
instancepublic StructuredTextRecord parse(String text)
String
and
return the resulting data.text
- String
containing structured textStructuredTextRecord
instanceCopyright © 2000–2024 Packwood Software. All rights reserved.