tomp.xml.type
Class TypeDatabaseImpl

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bytomp.xml.type.TypeDatabaseImpl
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, HasResult, TypeDatabase, TypeTransformationFactory

public class TypeDatabaseImpl
extends org.xml.sax.helpers.DefaultHandler
implements TypeDatabase, TypeTransformationFactory, HasResult


Field Summary
protected  MultiFilterTypeTransformation currentMultiTransformation
           
protected  java.lang.String currentSource
           
protected  Type currentSrcType
           
protected  java.lang.String currentTarget
           
protected  Type currentTargetType
           
protected  TypeTransformation currentTransformation
           
protected  Type currentType
           
protected  Variant currentVariant
           
protected  java.util.Map doctype2type
           
protected  java.util.Map identification2type
           
protected  TypeDatabase parentDatabase
          parent type database.
protected  java.util.Map root2type
           
protected  Transformations transformations
           
protected  XTFilterFactory xff
           
 
Constructor Summary
TypeDatabaseImpl()
           
 
Method Summary
 void addTransformation(Type source, Type target, Variant variant, TypeTransformation tt)
          implementation of transformation info storage
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Filter an end element event.
 TypeDatabase getParent()
           
 javax.xml.transform.Result getResult()
           
 TypeTransformation getTransformation(Type source, Type target, Variant variant)
           
 Transformations getTransformations()
           
 java.util.List getTransformationSequence(Type source, Type target, Variant variant)
           
 Type getType(java.lang.String id)
           
 Type getTypeForDoctype(java.lang.String name, java.lang.String dtPublic, java.lang.String dtSystem)
           
 Type getTypeForRootElement(java.lang.String ns, java.lang.String localName)
          implementation of type info storage
 int getTypesCount()
           
 void characters(char[] ch, int start, int length)
          Filter a character data event.
 TypeTransformation newTransformationForFilterClassName(java.lang.String fn)
           
 TypeTransformation newTransformationForSTXStyleSystemId(java.lang.String ssi)
           
 TypeTransformation newTransformationForStyleSystemId(java.lang.String ssi)
           
 void setParent(TypeDatabase td)
           
 void setXTFilterFactory(XTFilterFactory x)
           
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Filter a start element event.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xff

protected XTFilterFactory xff

parentDatabase

protected TypeDatabase parentDatabase
parent type database. If it is set, then all queries not answered here are forwarded to parent TD


currentType

protected Type currentType

currentSrcType

protected Type currentSrcType

currentTargetType

protected Type currentTargetType

currentSource

protected java.lang.String currentSource

currentTarget

protected java.lang.String currentTarget

currentTransformation

protected TypeTransformation currentTransformation

currentMultiTransformation

protected MultiFilterTypeTransformation currentMultiTransformation

currentVariant

protected Variant currentVariant

identification2type

protected java.util.Map identification2type

root2type

protected java.util.Map root2type

doctype2type

protected java.util.Map doctype2type

transformations

protected Transformations transformations
Constructor Detail

TypeDatabaseImpl

public TypeDatabaseImpl()
Method Detail

setXTFilterFactory

public void setXTFilterFactory(XTFilterFactory x)

getParent

public TypeDatabase getParent()

setParent

public void setParent(TypeDatabase td)

getResult

public javax.xml.transform.Result getResult()
Specified by:
getResult in interface HasResult

getTypesCount

public int getTypesCount()

getTransformations

public Transformations getTransformations()
Specified by:
getTransformations in interface TypeDatabase

addTransformation

public void addTransformation(Type source,
                              Type target,
                              Variant variant,
                              TypeTransformation tt)
implementation of transformation info storage

Specified by:
addTransformation in interface TypeDatabase

getTransformation

public TypeTransformation getTransformation(Type source,
                                            Type target,
                                            Variant variant)
Specified by:
getTransformation in interface TypeDatabase

getTypeForRootElement

public Type getTypeForRootElement(java.lang.String ns,
                                  java.lang.String localName)
implementation of type info storage

Specified by:
getTypeForRootElement in interface TypeDatabase

getTypeForDoctype

public Type getTypeForDoctype(java.lang.String name,
                              java.lang.String dtPublic,
                              java.lang.String dtSystem)
Specified by:
getTypeForDoctype in interface TypeDatabase

getType

public Type getType(java.lang.String id)
Specified by:
getType in interface TypeDatabase

newTransformationForFilterClassName

public TypeTransformation newTransformationForFilterClassName(java.lang.String fn)
                                                       throws java.lang.ClassNotFoundException,
                                                              java.lang.InstantiationException,
                                                              java.lang.IllegalAccessException
Specified by:
newTransformationForFilterClassName in interface TypeTransformationFactory
Throws:
java.lang.ClassNotFoundException
java.lang.InstantiationException
java.lang.IllegalAccessException

newTransformationForStyleSystemId

public TypeTransformation newTransformationForStyleSystemId(java.lang.String ssi)
                                                     throws javax.xml.transform.TransformerConfigurationException
Specified by:
newTransformationForStyleSystemId in interface TypeTransformationFactory
Throws:
javax.xml.transform.TransformerConfigurationException

newTransformationForSTXStyleSystemId

public TypeTransformation newTransformationForSTXStyleSystemId(java.lang.String ssi)
                                                        throws javax.xml.transform.TransformerConfigurationException
Specified by:
newTransformationForSTXStyleSystemId in interface TypeTransformationFactory
Throws:
javax.xml.transform.TransformerConfigurationException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Filter a start element event.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Parameters:
uri - The element's Namespace URI, or the empty string.
localName - The element's local name, or the empty string.
qName - The element's qualified (prefixed) name, or the empty string.
atts - The element's attributes.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Filter an end element event.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Parameters:
uri - The element's Namespace URI, or the empty string.
localName - The element's local name, or the empty string.
qName - The element's qualified (prefixed) name, or the empty string.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Filter a character data event.

Specified by:
characters in interface org.xml.sax.ContentHandler
Parameters:
ch - An array of characters.
start - The starting position in the array.
length - The number of characters to use from the array.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.

getTransformationSequence

public java.util.List getTransformationSequence(Type source,
                                                Type target,
                                                Variant variant)
Specified by:
getTransformationSequence in interface TypeDatabase