Package org.geotools.gml.producer
Class FeatureTypeTransformer
Object
TransformerBase
FeatureTypeTransformer
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 |
| org.locationtech.jts.geom.Point | gml:PointPropertyType |
| org.locationtech.jts.geom.LineString | gml:LineStringPropertyType |
| org.locationtech.jts.geom.Polygon | gml:PolygonPropertyType |
| org.locationtech.jts.geom.MultiPoint | gml:MultiPointPropertyType |
| org.locationtech.jts.geom.MultiLineString | gml:MutliLineStringPropertyType |
| org.locationtech.jts.geom.MultiPolygon | gml:MultiPolygonPropertyType |
| org.geotools.data.Feature | gml:AbstractFeatureType |
- Author:
- Simon Raess
- TODO:
- TODO: Support GeometryCollection., REVISIT: Should support a bit more for the header, like being able to set the schemaLocation. It also should declare and import the gml namespace - it's always used as all extend gml:AbstractFeatureType. Also should be able to set the global substitution group, so that this type can be used directly as a feature.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA FeatureTypeTranslator encodes FeatureTypes as a (hopefully) valid XML schema.Nested classes/interfaces inherited from class TransformerBase
TransformerBase.SchemaLocationSupport, TransformerBase.Task, TransformerBase.TranslatorSupport, TransformerBase.XMLReaderSupport -
Field Summary
Fields inherited from class TransformerBase
XMLNS_NAMESPACE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTranslator(ContentHandler handler) Creates a Translator that is capable to translate FeatureType objects into a XML schema fragment.Methods inherited from class TransformerBase
createTransformer, createTransformTask, createXMLReader, getEncoding, getIndentation, isNamespaceDeclartionEnabled, isOmitXMLDeclaration, setEncoding, setIndentation, setNamespaceDeclarationEnabled, setOmitXMLDeclaration, transform, transform, transform, transform
-
Constructor Details
-
FeatureTypeTransformer
public FeatureTypeTransformer()
-
-
Method Details
-
createTranslator
Creates a Translator that is capable to translate FeatureType objects into a XML schema fragment.- Specified by:
createTranslatorin classTransformerBase- Parameters:
handler- the content handler to use
-