org.geotools.xml.transform
Class TransformerBase.TranslatorSupport

java.lang.Object
  extended byorg.geotools.xml.transform.TransformerBase.TranslatorSupport
All Implemented Interfaces:
Translator
Direct Known Subclasses:
FeatureTransformer.FeatureTranslator, FeatureTypeTransformer.FeatureTypeTranslator, FilterTransformer.FilterTranslator, GeometryTransformer.GeometryTranslator
Enclosing class:
TransformerBase

protected abstract static class TransformerBase.TranslatorSupport
extends java.lang.Object
implements Translator

Support for writing Translators.


Field Summary
protected  org.xml.sax.ContentHandler contentHandler
           
protected  org.xml.sax.helpers.NamespaceSupport nsSupport
           
protected  org.xml.sax.Attributes NULL_ATTS
           
protected  boolean running
          Subclasses should check this flag in case an abort message was sent and stop any internal iteration if false.
protected  TransformerBase.SchemaLocationSupport schemaLocation
           
 
Constructor Summary
TransformerBase.TranslatorSupport(org.xml.sax.ContentHandler contentHandler, java.lang.String prefix, java.lang.String nsURI)
           
TransformerBase.TranslatorSupport(org.xml.sax.ContentHandler contentHandler, java.lang.String prefix, java.lang.String nsURI, TransformerBase.SchemaLocationSupport schemaLocation)
           
 
Method Summary
 void abort()
          Abort any translating activity.
protected  void addNamespaceDeclarations(TransformerBase.TranslatorSupport trans)
          Utility method to copy namespace declarations from "sub" translators into this ns support...
protected  void chars(java.lang.String text)
           
protected  void element(java.lang.String element, java.lang.String content)
           
protected  void element(java.lang.String element, java.lang.String content, org.xml.sax.Attributes atts)
           
protected  void end(java.lang.String element)
           
 java.lang.String getDefaultNamespace()
          Get the default URI used by this Translator for encoding.
 java.lang.String getDefaultPrefix()
          Get the default prefix used by this Translator for encoding.
 org.xml.sax.helpers.NamespaceSupport getNamespaceSupport()
          Obtain the namespace prefixes and URIs to be included in the output document.
 TransformerBase.SchemaLocationSupport getSchemaLocationSupport()
          Gets the location of the schemas used in this translator.
protected  void start(java.lang.String element)
           
protected  void start(java.lang.String element, org.xml.sax.Attributes atts)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.xml.transform.Translator
encode
 

Field Detail

contentHandler

protected final org.xml.sax.ContentHandler contentHandler

NULL_ATTS

protected final org.xml.sax.Attributes NULL_ATTS

nsSupport

protected org.xml.sax.helpers.NamespaceSupport nsSupport

schemaLocation

protected TransformerBase.SchemaLocationSupport schemaLocation

running

protected volatile boolean running
Subclasses should check this flag in case an abort message was sent and stop any internal iteration if false.

Constructor Detail

TransformerBase.TranslatorSupport

public TransformerBase.TranslatorSupport(org.xml.sax.ContentHandler contentHandler,
                                         java.lang.String prefix,
                                         java.lang.String nsURI)

TransformerBase.TranslatorSupport

public TransformerBase.TranslatorSupport(org.xml.sax.ContentHandler contentHandler,
                                         java.lang.String prefix,
                                         java.lang.String nsURI,
                                         TransformerBase.SchemaLocationSupport schemaLocation)
Method Detail

abort

public void abort()
Description copied from interface: Translator
Abort any translating activity. This is needed as some translators iterate internally on a data structure. The abort method should silently fail or succeed based upon the state of a translation.

Specified by:
abort in interface Translator

addNamespaceDeclarations

protected void addNamespaceDeclarations(TransformerBase.TranslatorSupport trans)
Utility method to copy namespace declarations from "sub" translators into this ns support...


element

protected void element(java.lang.String element,
                       java.lang.String content)

element

protected void element(java.lang.String element,
                       java.lang.String content,
                       org.xml.sax.Attributes atts)

start

protected void start(java.lang.String element)

start

protected void start(java.lang.String element,
                     org.xml.sax.Attributes atts)

chars

protected void chars(java.lang.String text)

end

protected void end(java.lang.String element)

getDefaultNamespace

public java.lang.String getDefaultNamespace()
Description copied from interface: Translator
Get the default URI used by this Translator for encoding. Optional.

Specified by:
getDefaultNamespace in interface Translator

getDefaultPrefix

public java.lang.String getDefaultPrefix()
Description copied from interface: Translator
Get the default prefix used by this Translator for encoding. Optional.

Specified by:
getDefaultPrefix in interface Translator

getNamespaceSupport

public org.xml.sax.helpers.NamespaceSupport getNamespaceSupport()
Description copied from interface: Translator
Obtain the namespace prefixes and URIs to be included in the output document.

Specified by:
getNamespaceSupport in interface Translator
Returns:
An instance of NamespaceSupport.

getSchemaLocationSupport

public TransformerBase.SchemaLocationSupport getSchemaLocationSupport()
Description copied from interface: Translator
Gets the location of the schemas used in this translator. Optional.

Specified by:
getSchemaLocationSupport in interface Translator


Copyright © GeoTools. All Rights Reserved.