|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectFormat
AbstractParser
MathTransformParser
Parser
public class Parser
Parser for
Well
Known Text (WKT). This parser can parse math transform
objects as well, which is part of the WKT's FITTED_CS
element.
modules/library/referencing (gt-referencing.jar)
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Format |
---|
Format.Field |
Field Summary | |
---|---|
protected CRSFactory |
crsFactory
The factory to use for creating coordinate reference systems. |
protected CSFactory |
csFactory
The factory to use for creating coordinate systems. |
protected DatumFactory |
datumFactory
The factory to use for creating datum. |
Fields inherited from class MathTransformParser |
---|
mtFactory |
Constructor Summary | |
---|---|
Parser()
Constructs a parser using the default set of symbols and factories. |
|
Parser(Symbols symbols)
Constructs a parser for the specified set of symbols using default factories. |
|
Parser(Symbols symbols,
DatumFactory datumFactory,
CSFactory csFactory,
CRSFactory crsFactory,
MathTransformFactory mtFactory)
Constructs a parser for the specified set of symbols using the specified factories. |
|
Parser(Symbols symbols,
ReferencingFactoryContainer factories)
Constructs a parser for the specified set of symbols using the specified set of factories. |
Method Summary | |
---|---|
protected Map<String,Object> |
alterProperties(Map<String,Object> properties)
Returns the properties to be given to the parsed object. |
static Class<?> |
getClassOf(String element)
Returns the class of the specified WKT element. |
static String |
getNameOf(Class<?> type)
Returns the WKT name of the specified object type. |
static void |
main(String[] args)
Read WKT strings from the standard input stream and reformat them to the standard output stream. |
protected Object |
parse(Element element)
Parses the next element in the specified Well Know Text (WKT) tree. |
CoordinateReferenceSystem |
parseCoordinateReferenceSystem(String text)
Parses a coordinate reference system element. |
Methods inherited from class MathTransformParser |
---|
parseMathTransform |
Methods inherited from class AbstractParser |
---|
format, getAuthority, getTree, getWarning, isColorEnabled, parseObject, parseObject, reformat, setAuthority, setColorEnabled |
Methods inherited from class Format |
---|
clone, format, formatToCharacterIterator |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final DatumFactory datumFactory
protected final CSFactory csFactory
protected final CRSFactory crsFactory
Constructor Detail |
---|
public Parser()
public Parser(Symbols symbols)
symbols
- The symbols for parsing and formatting numbers.public Parser(Symbols symbols, ReferencingFactoryContainer factories)
symbols
- The symbols for parsing and formatting numbers.factories
- The factories to use.public Parser(Symbols symbols, DatumFactory datumFactory, CSFactory csFactory, CRSFactory crsFactory, MathTransformFactory mtFactory)
symbols
- The symbols for parsing and formatting numbers.datumFactory
- The factory to use for creating datum.csFactory
- The factory to use for creating coordinate systems.crsFactory
- The factory to use for creating coordinate reference systems.mtFactory
- The factory to use for creating math transform objects.Method Detail |
---|
public CoordinateReferenceSystem parseCoordinateReferenceSystem(String text) throws ParseException
text
- The text to be parsed.
ParseException
- if the string can't be parsed.protected Object parse(Element element) throws ParseException
parse
in class MathTransformParser
element
- The element to be parsed.
ParseException
- if the element can't be parsed.protected Map<String,Object> alterProperties(Map<String,Object> properties)
AUTHORITY
element,
and returns on output the properties to give to the object to be created. The default
implementation returns the properties
map unchanged. Subclasses may override
this method in order to add or change properties.
Example: if a subclass want to add automatically an authority code when
no AUTHORITY
element was explicitly set in the WKT, then it may test for the
IdentifiedObject.IDENTIFIERS_KEY
key and add automatically an entry if this
key was missing.
properties
- The properties parsed from the WKT file. Entries can be added, removed
or modified directly in this map.
properties
(maybe after modifications), but could also be a new map.public static Class<?> getClassOf(String element)
ProjectedCRS.class
for element "PROJCS
".
element
- The WKT element name.
null
if unknow.public static String getNameOf(Class<?> type)
PROJCS
" for type ProjectedCRS.class
.
type
- The GeoAPI class of the specified element.
null
if unknow.public static void main(String[] args)
[Ctrl-Z]
if
reading from the keyboard), or until an unparsable WKT has been hit.
Optional arguments are:
-authority <name> |
The authority to prefer when choosing WKT entities names. |
-indentation <value> |
Set the indentation (0 for output on a single line) |
-encoding <code> |
Set the character encoding |
-locale <language> |
Set the language for the output (e.g. "fr" for French) |
args
- The command line arguments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |