public class Formattable extends Object
Modifier and Type | Field and Description |
---|---|
static int |
SINGLE_LINE
The indentation value to give to
toWKT(int) method for formatting the complete
object on a single line. |
Modifier | Constructor and Description |
---|---|
protected |
Formattable()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
cleanupThreadLocals()
Cleans up the thread local set in this thread.
|
protected String |
formatWKT(Formatter formatter)
Format the inner part of a Well
Known Text (WKT) element.
|
String |
toString()
Returns a string representation for this object.
|
String |
toWKT()
Returns a Well
Known Text (WKT) using a default indentation.
|
String |
toWKT(Citation authority,
int indentation)
Returns a Well
Known Text (WKT) for this object using the specified indentation and authority.
|
String |
toWKT(int indentation)
Returns a Well
Known Text (WKT) for this object using the specified indentation.
|
String |
toWKT(int indentation,
boolean strict)
Returns a Well
Known Text (WKT) for this object using the specified indentation.
|
public static final int SINGLE_LINE
toWKT(int)
method for formatting the complete
object on a single line.public String toString()
toWKT()
, except that no exception is thrown if the string
contains non-standard keywords. For example the WKT
specification do not defines any keyword for coordinate system objects. If this object is an
instance of DefaultCartesianCS
, then the WKT will be
formatted as "CartesianCS[AXIS["
..."], AXIS["
..."],
etc.]"
.public String toWKT() throws UnformattableObjectException
UnformattableObjectException
- If this object can't be formatted as WKT. A formatting
may fails because an object is too complex for the WKT format capability (for example an
engineering CRS with
different unit for each axis), or because only some specific implementations can be
formatted as WKT.public String toWKT(int indentation) throws UnformattableObjectException
indentation
- The amount of spaces to use in indentation for WKT formatting, or SINGLE_LINE
for formatting the whole WKT on a single line.UnformattableObjectException
- If this object can't be formatted as WKT. A formatting
may fails because an object is too complex for the WKT format capability (for example an
engineering CRS with
different unit for each axis), or because only some specific implementations can be
formatted as WKT.public String toWKT(int indentation, boolean strict) throws UnformattableObjectException
false
the check is not performed. When true
and the WKT is found to be invalid a UnformattableObjectException
is thrown.
indentation
- The amount of spaces to use in indentation for WKT formatting, or SINGLE_LINE
for formatting the whole WKT on a single line.strict
- Controls the check for validity.UnformattableObjectException
- If this object can't be formatted as WKT. A formatting
may fails because an object is too complex for the WKT format capability (for example an
engineering CRS with
different unit for each axis), or because only some specific implementations can be
formatted as WKT.public String toWKT(Citation authority, int indentation) throws UnformattableObjectException
authority
- The authority to prefer when choosing WKT entities names.indentation
- The amount of spaces to use in indentation for WKT formatting, or SINGLE_LINE
for formatting the whole WKT on a single line.UnformattableObjectException
- If this object can't be formatted as WKT. A formatting
may fails because an object is too complex for the WKT format capability (for example an
engineering CRS with
different unit for each axis), or because only some specific implementations can be
formatted as WKT.protected String formatWKT(Formatter formatter)
Formatter.append(Formattable)
. Element name and authority code must not be formatted here.
For example for a GEOGCS
element (DefaultGeographicCRS
), the formatter will invokes this method
for completing the WKT at the insertion point show below:
GEOGCS["WGS 84", AUTHORITY["EPSG","4326"]] | (insertion point)The default implementation declares that this object produces an invalid WKT. Subclasses must override this method for proper WKT formatting and should not invoke
super.formatWKT(formatter)
if they can use a valid WKT syntax.formatter
- The formatter to use."GEOGCS"
).toWKT()
,
toString()
public static void cleanupThreadLocals()
Copyright © 1996–2019 Geotools. All rights reserved.