# Interface Parser

All Known Implementing Classes:
  `DefaultMathTransformFactory, GeodeticObjectFactory`

public interface Parser
A parser or a factory capable to create an object from a string in the WKT format. The created objects may be Coordinate Reference Systems, Math Transforms or geometric objects for instance.

Parsing services may be provided by factories which implement this interface:

- `GeodeticObjectFactory​.createFromWKT(String)`
- `DefaultMathTransformFactory​.createFromWKT(String)`

Similar services are also available as convenience static methods:

- `CRS​.fromWKT(String)`
- `Envelopes​.fromWKT(CharSequence)`

Non-fatal anomalies found in Well Known Texts are reported in a logger named `"org​.apache​.sis​.io​.wkt"`. Warnings may be for unknown or unsupported WKT elements, inconsistent unit definitions (unit symbol, scale factor or EPSG code), unparsable axis abbreviations, etc. However, this parser does not verify if the overall parsed object matches the EPSG (or other authority) definition. For such verification, see `CRS​.fromWKT(String)`.

Since:
  0.6

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `createFromWKT(String wkt)`
  Creates the object from a string.

- ## Method Details

  - ### createFromWKT

    Object createFromWKT(String wkt) throws FactoryException
    Creates the object from a string. Objects returned by this method are typically (but not necessarily) Coordinate Reference Systems or Math Transforms. If the given text contains non-fatal anomalies, warnings may be reported in a logger named `"org​.apache​.sis​.io​.wkt"`.

    #### Handling of warnings

    For processing warnings in a different way than logging them, one can use `CompoundFormat​.parseObject(String)` followed by a call to `WKTFormat​.getWarnings()`.
    Parameters:
      `wkt` - object encoded in Well-Known Text format (version 1 or 2).
    Returns:
      the result of parsing the given text.
    Throws:
      `FactoryException` - if the object creation failed.