| java.lang.Object java.text.Format org.geotools.referencing.wkt.AbstractParser
All known Subclasses: org.geotools.referencing.wkt.MathTransformParser,
Field Summary | |
final Symbols | symbols The symbols to use for parsing WKT. |
Constructor Summary | |
public | AbstractParser(Symbols symbols) Constructs a parser using the specified set of symbols. |
Method Summary | |
public StringBuffer | format(Object object, StringBuffer toAppendTo, FieldPosition pos) Format the specified object as a Well Know Text. | public Citation | getAuthority() Returns the preferred authority for formatting WKT entities. | final protected Element | getTree(String text, ParsePosition position) Returns a tree of
Element for the specified text. | public String | getWarning() If a warning occured during the last WKT
,
returns the warning. | public boolean | isColorEnabled() Returns
true if syntax coloring is enabled. | abstract protected Object | parse(Element element) Parses the next element in the specified Well Know Text (WKT) tree.
Parameters: element - The element to be parsed. | final Number | parseNumber(String text, ParsePosition position) Parse the number at the given position. | final public Object | parseObject(String text) Parses a Well Know Text (WKT).
Parameters: text - The text to be parsed. | final public Object | parseObject(String text, ParsePosition position) Parses a Well Know Text (WKT).
Parameters: text - The text to be parsed. Parameters: position - The position to start parsing from. | public void | reformat(BufferedReader in, Writer out, PrintWriter err) Read WKT strings from an input stream and reformat them to the specified
output stream. | static void | reportError(PrintWriter err, String line, int errorOffset) Report a failure while parsing the specified line.
Parameters: err - The stream where to report the failure. Parameters: line - The line that failed. Parameters: errorOffset - The error offset in the specified line. | public void | setAuthority(Citation authority) Set the preferred authority for formatting WKT entities. | public void | setColorEnabled(boolean enabled) Enables or disables syntax coloring on ANSI X3.64 (aka ECMA-48 and ISO/IEC 6429) compatible
terminal. |
symbols | final Symbols symbols(Code) | | The symbols to use for parsing WKT.
|
AbstractParser | public AbstractParser(Symbols symbols)(Code) | | Constructs a parser using the specified set of symbols.
|
getAuthority | public Citation getAuthority()(Code) | | Returns the preferred authority for formatting WKT entities.
The
AbstractParser.format format methods will uses the name specified
by this authority, if available.
|
getTree | final protected Element getTree(String text, ParsePosition position) throws ParseException(Code) | | Returns a tree of
Element for the specified text.
Parameters: text - The text to parse. Parameters: position - In input, the position where to start parsing from.In output, the first character after the separator. |
getWarning | public String getWarning()(Code) | | If a warning occured during the last WKT
,
returns the warning. Otherwise returns
null . The warning is cleared
every time a new object is formatted.
since: 2.4 |
isColorEnabled | public boolean isColorEnabled()(Code) | | Returns
true if syntax coloring is enabled.
By default, syntax coloring is disabled.
since: 2.4 |
parse | abstract protected Object parse(Element element) throws ParseException(Code) | | Parses the next element in the specified Well Know Text (WKT) tree.
Parameters: element - The element to be parsed. The object. throws: ParseException - if the element can't be parsed. |
parseObject | final public Object parseObject(String text, ParsePosition position)(Code) | | Parses a Well Know Text (WKT).
Parameters: text - The text to be parsed. Parameters: position - The position to start parsing from. The object. |
reformat | public void reformat(BufferedReader in, Writer out, PrintWriter err) throws IOException(Code) | | Read WKT strings from an input stream and reformat them to the specified
output stream. WKT strings are read until the the end-of-stream, or until
an unparsable WKT has been hit. In this later case, an error message is
formatted to the specified error stream.
Parameters: in - The input stream. Parameters: out - The output stream. Parameters: err - The error stream. throws: IOException - if an error occured while reading from the input streamor writting to the output stream. |
reportError | static void reportError(PrintWriter err, String line, int errorOffset)(Code) | | Report a failure while parsing the specified line.
Parameters: err - The stream where to report the failure. Parameters: line - The line that failed. Parameters: errorOffset - The error offset in the specified line. This is usually thevalue provided by ParseException.getErrorOffset. |
setAuthority | public void setAuthority(Citation authority)(Code) | | Set the preferred authority for formatting WKT entities.
The
AbstractParser.format format methods will uses the name specified
by this authority, if available.
|
|
|