org.geotools.geojson
Class GeoJSONUtil

Object
  extended by GeoJSONUtil

public class GeoJSONUtil
extends Object


Field Summary
static SimpleDateFormat DATE_FORMAT
          Date format (ISO 8601)
 
Constructor Summary
GeoJSONUtil()
           
 
Method Summary
static boolean addOrdinate(List ordinates, Object value)
           
static StringBuilder array(String key, Object value, StringBuilder sb)
           
static Coordinate createCoordinate(List ordinates)
           
static Coordinate[] createCoordinates(List coordinates)
           
static void encode(Map<String,Object> obj, Object output)
           
static void encode(String json, Object output)
           
static StringBuilder entry(String key, Object value, StringBuilder sb)
           
static StringBuilder nul(StringBuilder sb)
           
static
<T> T
parse(IContentHandler<T> handler, Object input, boolean trace)
           
static StringBuilder string(String string, StringBuilder sb)
           
static Reader toReader(Object input)
          Converts an object to a Reader instance.
static Writer toWriter(Object output)
          Converts an object to Writer instance.
static
<T> T
trace(T handler, Class<T> clazz)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMAT

public static SimpleDateFormat DATE_FORMAT
Date format (ISO 8601)

Constructor Detail

GeoJSONUtil

public GeoJSONUtil()
Method Detail

toReader

public static Reader toReader(Object input)
                       throws IOException
Converts an object to a Reader instance.

The input parameter may be one of the following types:

* A string parameter is considered a file path.

Parameters:
input - The input object.
Returns:
A reader.
Throws:
IOException

toWriter

public static Writer toWriter(Object output)
                       throws IOException
Converts an object to Writer instance.

The output parameter may be one of the following types:

* A string parameter is considered a file path.

Parameters:
output - The output object.
Returns:
A writer.
Throws:
IOException

string

public static StringBuilder string(String string,
                                   StringBuilder sb)

entry

public static StringBuilder entry(String key,
                                  Object value,
                                  StringBuilder sb)

array

public static StringBuilder array(String key,
                                  Object value,
                                  StringBuilder sb)

nul

public static StringBuilder nul(StringBuilder sb)

trace

public static <T> T trace(T handler,
                          Class<T> clazz)

addOrdinate

public static boolean addOrdinate(List ordinates,
                                  Object value)

createCoordinate

public static Coordinate createCoordinate(List ordinates)

createCoordinates

public static Coordinate[] createCoordinates(List coordinates)

parse

public static <T> T parse(IContentHandler<T> handler,
                          Object input,
                          boolean trace)
               throws IOException
Throws:
IOException

encode

public static void encode(String json,
                          Object output)
                   throws IOException
Throws:
IOException

encode

public static void encode(Map<String,Object> obj,
                          Object output)
                   throws IOException
Throws:
IOException


Copyright © 1996-2014 Geotools. All Rights Reserved.