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:
-
Field Summary
Fields inherited from class TransformerBase.TranslatorSupport
contentHandler, nsSupport, NULL_ATTS, running, schemaLocation -
Constructor Summary
ConstructorsConstructorDescriptionFeatureTypeTranslator(ContentHandler handler) Creates a new FeatureTypeTranslator. -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributesImplcreateStandardAttributes(AttributeDescriptor attribute) Creates standard xml attributes present on all xs:element elements.voidEncode object o, which must be an instance of FeatureType.protected voidencode(SimpleFeatureType type) Encode the supplied feature type.protected voidencode(AttributeDescriptor attribute) Encode an AttributeType.protected voidencodeBoolean(AttributeDescriptor attribute) Encode an AttributeType whose value type is a Boolean.protected voidencodeDate(AttributeDescriptor attribute) Encode an AttributeType whose value type is a Date.protected voidencodeGeometry(AttributeDescriptor attribute) Encode an AttributeType whose value type is a Geometry.protected voidencodeNumber(AttributeDescriptor attribute) Encode an AttributeType whose value type is a Number.protected voidencodeString(AttributeDescriptor attribute) Encode an AttributeType whose value type is a String.protected voidEnd the schema fragment for a feature type.protected final voidstartSchemaType(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 Details
-
FeatureTypeTranslator
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 Details
-
encode
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:
-
encode
Encode the supplied feature type.- Parameters:
type- the feature type to encode
-
startSchemaType
Start the schema fragment for a feature type.- Throws:
SAXException
-
endSchemaType
End the schema fragment for a feature type.- Throws:
SAXException
-
encode
Encode an AttributeType.- Throws:
SAXException
-
encodeBoolean
Encode an AttributeType whose value type is a Boolean.- Throws:
SAXException
-
encodeString
Encode an AttributeType whose value type is a String.- Parameters:
attribute- the attribute to encode- Throws:
SAXException
-
encodeNumber
Encode an AttributeType whose value type is a Number.- Throws:
SAXException
-
encodeDate
Encode an AttributeType whose value type is a Date.- Throws:
SAXException
-
encodeGeometry
Encode an AttributeType whose value type is a Geometry.- Throws:
SAXException
-
createStandardAttributes
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
-