org.geotools.gml.producer
Class FeatureTypeTransformer

java.lang.Object
  extended by org.geotools.xml.transform.TransformerBase
      extended by org.geotools.gml.producer.FeatureTypeTransformer

public class FeatureTypeTransformer
extends TransformerBase

Transformer that transforms feature types into (hopefully) valid XML schemas. This class may be used by geoserver in the future to automatically create XML schemas for the DescribeFeatureType request.

   FeatureType type = ...; // you have it from somewhere
   FeatureTypeTransformer t = new FeatureTypeTransformer();
   t.transform(type, System.out);
 
The following table lists the mapping between java types and xml schema data types for attribute types.
Java XML Schema
String xs:string
Byte xs:byte
Short xs:short
Integer xs:int
Long xs:long
BigInteger xs:integer
BigDecimal xs:decimal
java.util.Date xs:dateTime
java.sql.Date xs:date
java.sql.Time xs:time
java.sql.Timestamp xs:dateTime
java.lang.Boolean xs:boolean
com.vividsolutions.jts.geom.Point gml:PointPropertyType
com.vividsolutions.jts.geom.LineString gml:LineStringPropertyType
com.vividsolutions.jts.geom.Polygon gml:PolygonPropertyType
com.vividsolutions.jts.geom.MultiPoint gml:MultiPointPropertyType
com.vividsolutions.jts.geom.MultiLineString gml:MutliLineStringPropertyType
com.vividsolutions.jts.geom.MultiPolygon gml:MultiPolygonPropertyType
org.geotools.data.Feature gml:AbstractFeatureType

Version:
$Id: FeatureTypeTransformer.java 30921 2008-07-05 07:51:23Z jgarnett $
Author:
Simon Raess

Nested Class Summary
static class FeatureTypeTransformer.FeatureTypeTranslator
          A FeatureTypeTranslator encodes FeatureTypes as a (hopefully) valid XML schema.
 
Nested classes/interfaces inherited from class org.geotools.xml.transform.TransformerBase
TransformerBase.SchemaLocationSupport, TransformerBase.Task, TransformerBase.TranslatorSupport, TransformerBase.XMLReaderSupport
 
Field Summary
 
Fields inherited from class org.geotools.xml.transform.TransformerBase
XMLNS_NAMESPACE
 
Constructor Summary
FeatureTypeTransformer()
           
 
Method Summary
 Translator createTranslator(org.xml.sax.ContentHandler handler)
          Creates a Translator that is capable to translate FeatureType objects into a XML schema fragment.
 
Methods inherited from class org.geotools.xml.transform.TransformerBase
createTransformer, createTransformTask, createXMLReader, getEncoding, getIndentation, isNamespaceDeclartionEnabled, isOmitXMLDeclaration, setEncoding, setIndentation, setNamespaceDeclarationEnabled, setOmitXMLDeclaration, transform, transform, transform, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureTypeTransformer

public FeatureTypeTransformer()
Method Detail

createTranslator

public Translator createTranslator(org.xml.sax.ContentHandler handler)
Creates a Translator that is capable to translate FeatureType objects into a XML schema fragment.

Specified by:
createTranslator in class TransformerBase
Parameters:
handler - the content handler to use
Returns:
DOCUMENT ME!


Copyright © 1996-2010 Geotools. All Rights Reserved.