org.geotools.gml.producer
Class FeatureTypeTransformer.FeatureTypeTranslator

java.lang.Object
  extended byorg.geotools.xml.transform.TransformerBase.TranslatorSupport
      extended byorg.geotools.gml.producer.FeatureTypeTransformer.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 org.geotools.xml.transform.TransformerBase.TranslatorSupport
contentHandler, nsSupport, NULL_ATTS, running, schemaLocation
 
Constructor Summary
FeatureTypeTransformer.FeatureTypeTranslator(org.xml.sax.ContentHandler handler)
          Creates a new FeatureTypeTranslator.
 
Method Summary
protected  org.xml.sax.helpers.AttributesImpl createStandardAttributes(AttributeType attribute)
          Creates standard xml attributes present on all xs:element elements.
protected  void encode(AttributeType attribute)
          Encode an AttributeType.
protected  void encode(FeatureType type)
          Encode the supplied feature type.
 void encode(java.lang.Object o)
          Encode object o, which must be an instance of FeatureType.
protected  void encodeBoolean(AttributeType attribute)
          Encode an AttributeType whose value type is a Boolean.
protected  void encodeDate(AttributeType attribute)
          Encode an AttributeType whose value type is a Date.
protected  void encodeGeometry(AttributeType attribute)
          Encode an AttributeType whose value type is a Geometry.
protected  void encodeNumber(AttributeType attribute)
          Encode an AttributeType whose value type is a Number.
protected  void encodeString(AttributeType attribute)
          Encode an AttributeType whose value type is a String.
protected  void endSchemaType()
          End the schema fragment for a feature type.
protected  void startSchemaType(java.lang.String name, java.net.URI namespace)
          Start the schema fragment for a feature type.
 
Methods inherited from class org.geotools.xml.transform.TransformerBase.TranslatorSupport
abort, addNamespaceDeclarations, chars, element, element, end, getDefaultNamespace, getDefaultPrefix, getNamespaceSupport, getSchemaLocationSupport, start, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureTypeTransformer.FeatureTypeTranslator

public FeatureTypeTransformer.FeatureTypeTranslator(org.xml.sax.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(java.lang.Object o)
            throws java.lang.IllegalArgumentException
Encode object o, which must be an instance of FeatureType. If it is not an IllegalArgumentException will be thrown.

Parameters:
o - DOCUMENT ME!
Throws:
java.lang.IllegalArgumentException - if supplied object is not an instance of FeatureType
See Also:
Translator.encode(java.lang.Object)

encode

protected void encode(FeatureType type)
Encode the supplied feature type.

Parameters:
type - the feature type to encode
Throws:
java.lang.RuntimeException - DOCUMENT ME!

startSchemaType

protected void startSchemaType(java.lang.String name,
                               java.net.URI namespace)
                        throws org.xml.sax.SAXException
Start the schema fragment for a feature type.

Parameters:
name -
namespace - DOCUMENT ME!
Throws:
org.xml.sax.SAXException

endSchemaType

protected void endSchemaType()
                      throws org.xml.sax.SAXException
End the schema fragment for a feature type.

Throws:
org.xml.sax.SAXException

encode

protected void encode(AttributeType attribute)
               throws org.xml.sax.SAXException
Encode an AttributeType.

Parameters:
attribute -
Throws:
org.xml.sax.SAXException
java.lang.RuntimeException - DOCUMENT ME!

encodeBoolean

protected void encodeBoolean(AttributeType attribute)
                      throws org.xml.sax.SAXException
Encode an AttributeType whose value type is a Boolean.

Parameters:
attribute -
Throws:
org.xml.sax.SAXException

encodeString

protected void encodeString(AttributeType attribute)
                     throws org.xml.sax.SAXException
Encode an AttributeType whose value type is a String.

Parameters:
attribute - the attribute to encode
Throws:
org.xml.sax.SAXException

encodeNumber

protected void encodeNumber(AttributeType attribute)
                     throws org.xml.sax.SAXException
Encode an AttributeType whose value type is a Number.

Parameters:
attribute -
Throws:
org.xml.sax.SAXException
java.lang.RuntimeException - DOCUMENT ME!

encodeDate

protected void encodeDate(AttributeType attribute)
                   throws org.xml.sax.SAXException
Encode an AttributeType whose value type is a Date.

Parameters:
attribute -
Throws:
org.xml.sax.SAXException

encodeGeometry

protected void encodeGeometry(AttributeType attribute)
                       throws org.xml.sax.SAXException
Encode an AttributeType whose value type is a Geometry.

Parameters:
attribute -
Throws:
org.xml.sax.SAXException
java.lang.RuntimeException - DOCUMENT ME!

createStandardAttributes

protected org.xml.sax.helpers.AttributesImpl createStandardAttributes(AttributeType 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


Copyright © GeoTools. All Rights Reserved.