@Deprecated public class FormattableObject extends Object implements Formattable
Strict and lenient WKT formatting
Strict WKT formatting is performed by various
toWKT(...) methods. Those methods may
fail to format a particular object, in which case a
thrown. A formatting may fail because an object is too complex for the WKT format capability
(for example an
with different unit for different axis), or because only some specific implementations can be
formatted as WKT.
toString() implementation is like
toWKT() except that no
exception is thrown if the resulting WKT is not compliant with the specification. The
toString() method does not provide control over indentation and other features.
But if such control is desired, it can be obtained by using directly the
print() method is provided, which is roughly equivalent to
System.out.println(this) except that syntax coloring is automatically applied
if the terminal seems to support the
|Modifier||Constructor and Description|
|Modifier and Type||Method and Description|
Formats the inner part of a Well Known Text (WKT) element.
Prints a string representation of this object to the standard output stream.
Returns a string representation for this object.
Returns a Well Known Text (WKT) using the default indentation.
Returns a Well Known Text (WKT) for this object using the specified convention and indentation.
@Debug public void print()
X3.64standard, then a syntax coloring will be applied.
This is a convenience method for debugging purpose and for console applications.
Note: We don't use the standard error stream (the stream used by the Java logging framework) because it is different than the stream used by the console.
public String toString()
toWKT(), except that no exception is thrown if the string contains non-standard keywords. For example the WKT specification does not defines any keyword for coordinate system objects. If this object is an instance of
DefaultCartesianCS, then the WKT will be formatted as
public String toWKT() throws UnformattableObjectException
public String toWKT(Convention convention, int indentation) throws UnformattableObjectException
OGC, but other common conventions are
INTERNALconvention is a special value for debugging map projections.
convention- The convention for choosing WKT entities names. The default value is
indentation- The amount of spaces to use in indentation for WKT formatting, or -1 for formatting the whole WKT on a single line.
UnformattableObjectException- If this object can't be formatted as WKT.
Element name and authority code shall not be formatted here. For example for a
element, the formatter will invoke this method for completing the WKT at the 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 invokeGEOGCS["WGS 84", AUTHORITY["EPSG","4326"]] ↑ (insertion point)
super.formatWKT(formatter)if they can use a valid WKT syntax.
Copyright © 2009-2013 Geotoolkit.org. All Rights Reserved.