Package org.geotools.gml.producer
Class FeatureTypeTransformer.FeatureTypeTranslator
- Object
-
- TransformerBase.TranslatorSupport
-
- FeatureTypeTranslator
-
- All Implemented Interfaces:
Translator
- Enclosing class:
- FeatureTypeTransformer
public static class FeatureTypeTransformer.FeatureTypeTranslator extends TransformerBase.TranslatorSupport
A FeatureTypeTranslator encodes FeatureTypes as a (hopefully) valid XML schema.- See Also:
TransformerBase.TranslatorSupport
-
-
Field Summary
-
Fields inherited from class TransformerBase.TranslatorSupport
contentHandler, nsSupport, NULL_ATTS, running, schemaLocation
-
-
Constructor Summary
Constructors Constructor Description FeatureTypeTranslator(ContentHandler handler)
Creates a new FeatureTypeTranslator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AttributesImpl
createStandardAttributes(AttributeDescriptor attribute)
Creates standard xml attributes present on all xs:element elements.void
encode(Object o)
Encode object o, which must be an instance of FeatureType.protected void
encode(SimpleFeatureType type)
Encode the supplied feature type.protected void
encode(AttributeDescriptor attribute)
Encode an AttributeType.protected void
encodeBoolean(AttributeDescriptor attribute)
Encode an AttributeType whose value type is a Boolean.protected void
encodeDate(AttributeDescriptor attribute)
Encode an AttributeType whose value type is a Date.protected void
encodeGeometry(AttributeDescriptor attribute)
Encode an AttributeType whose value type is a Geometry.protected void
encodeNumber(AttributeDescriptor attribute)
Encode an AttributeType whose value type is a Number.protected void
encodeString(AttributeDescriptor attribute)
Encode an AttributeType whose value type is a String.protected void
endSchemaType()
End the schema fragment for a feature type.protected void
startSchemaType(String name, String namespace)
Start the schema fragment for a feature type.-
Methods inherited from class TransformerBase.TranslatorSupport
abort, addNamespaceDeclarations, cdata, chars, comment, commit, createAttributes, element, element, elementSafe, end, getDefaultNamespace, getDefaultPrefix, getNamespaceSupport, getSchemaLocationSupport, mark, reset, start, start
-
-
-
-
Constructor Detail
-
FeatureTypeTranslator
public FeatureTypeTranslator(ContentHandler handler)
Creates a new FeatureTypeTranslator. The default prefix is "xs" and the default namespace is "http://www.w3.org/2001/XMLSchema".- Parameters:
handler
- the content handler that receives the SAX events
-
-
Method Detail
-
encode
public void encode(Object o) throws IllegalArgumentException
Encode object o, which must be an instance of FeatureType. If it is not an IllegalArgumentException will be thrown.- Parameters:
o
- The Object to encode.- Throws:
IllegalArgumentException
- if supplied object is not an instance of FeatureType- See Also:
Translator.encode(java.lang.Object)
-
encode
protected void encode(SimpleFeatureType type)
Encode the supplied feature type.- Parameters:
type
- the feature type to encode
-
startSchemaType
protected final void startSchemaType(String name, String namespace) throws SAXException
Start the schema fragment for a feature type.- Throws:
SAXException
-
endSchemaType
protected void endSchemaType() throws SAXException
End the schema fragment for a feature type.- Throws:
SAXException
-
encode
protected void encode(AttributeDescriptor attribute) throws SAXException
Encode an AttributeType.- Throws:
SAXException
-
encodeBoolean
protected void encodeBoolean(AttributeDescriptor attribute) throws SAXException
Encode an AttributeType whose value type is a Boolean.- Throws:
SAXException
-
encodeString
protected void encodeString(AttributeDescriptor attribute) throws SAXException
Encode an AttributeType whose value type is a String.- Parameters:
attribute
- the attribute to encode- Throws:
SAXException
-
encodeNumber
protected void encodeNumber(AttributeDescriptor attribute) throws SAXException
Encode an AttributeType whose value type is a Number.- Throws:
SAXException
-
encodeDate
protected void encodeDate(AttributeDescriptor attribute) throws SAXException
Encode an AttributeType whose value type is a Date.- Throws:
SAXException
-
encodeGeometry
protected void encodeGeometry(AttributeDescriptor attribute) throws SAXException
Encode an AttributeType whose value type is a Geometry.- Throws:
SAXException
-
createStandardAttributes
protected AttributesImpl createStandardAttributes(AttributeDescriptor attribute)
Creates standard xml attributes present on all xs:element elements. These are name, maxOccurs, minOccurs and nillable.- Parameters:
attribute
- the attribute type from which the information is retrieved- Returns:
- an org.xml.sax.helpers.AttributesImpl object that contains the standard attributes
-
-