org.geotools.gml.producer
Class FeatureTypeTransformer.FeatureTypeTranslator

Object
  extended by TransformerBase.TranslatorSupport
      extended by 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 TransformerBase.TranslatorSupport
contentHandler, nsSupport, NULL_ATTS, running, schemaLocation
 
Constructor Summary
FeatureTypeTransformer.FeatureTypeTranslator(ContentHandler handler)
          Creates a new FeatureTypeTranslator.
 
Method Summary
protected  AttributesImpl createStandardAttributes(AttributeDescriptor attribute)
          Creates standard xml attributes present on all xs:element elements.
protected  void encode(AttributeDescriptor attribute)
          Encode an AttributeType.
 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 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, createAttributes, element, element, elementSafe, end, getDefaultNamespace, getDefaultPrefix, getNamespaceSupport, getSchemaLocationSupport, start, start
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureTypeTransformer.FeatureTypeTranslator

public FeatureTypeTransformer.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 - DOCUMENT ME!
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
Throws:
RuntimeException - DOCUMENT ME!

startSchemaType

protected final void startSchemaType(String name,
                                     String namespace)
                              throws SAXException
Start the schema fragment for a feature type.

Parameters:
name -
namespace - DOCUMENT ME!
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.

Parameters:
attribute -
Throws:
SAXException
RuntimeException - DOCUMENT ME!

encodeBoolean

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

Parameters:
attribute -
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.

Parameters:
attribute -
Throws:
SAXException
RuntimeException - DOCUMENT ME!

encodeDate

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

Parameters:
attribute -
Throws:
SAXException

encodeGeometry

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

Parameters:
attribute -
Throws:
SAXException
RuntimeException - DOCUMENT ME!

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


Copyright © 1996-2009 Geotools. All Rights Reserved.