net.ontopia.topicmaps.xml
Class XTMSnifferContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by net.ontopia.topicmaps.xml.XTMSnifferContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.DeclHandler, org.xml.sax.ext.LexicalHandler

public class XTMSnifferContentHandler
extends org.xml.sax.helpers.DefaultHandler
implements org.xml.sax.ext.DeclHandler, org.xml.sax.ext.LexicalHandler

INTERNAL: This content handler is used to detect whether the XTM event stream being read is an XTM 1.0 or 2.x document. Once this is clear, the handler configures the parser accordingly with the correct handlers.


Constructor Summary
XTMSnifferContentHandler(XTMTopicMapReader reader, TopicMapStoreFactoryIF store_factory, org.xml.sax.XMLReader parser, LocatorIF base_address)
           
 
Method Summary
 void attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String mode, java.lang.String value)
           
 void comment(char[] ch, int start, int length)
           
 void elementDecl(java.lang.String name, java.lang.String model)
           
 void endCDATA()
           
 void endDocument()
           
 void endDTD()
           
 void endElement(java.lang.String uri, java.lang.String name, java.lang.String qname)
           
 void endEntity(java.lang.String name)
           
 void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
           
 java.util.Collection getTopicMaps()
           
 XTMVersion getXTMVersion()
           
 void internalEntityDecl(java.lang.String name, java.lang.String value)
           
 void setDocumentLocator(org.xml.sax.Locator locator)
           
 void startCDATA()
           
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
           
 void startElement_(java.lang.String uri, java.lang.String name, java.lang.String qname, org.xml.sax.Attributes atts)
           
 void startElement(java.lang.String uri, java.lang.String name, java.lang.String qname, org.xml.sax.Attributes atts)
           
 void startEntity(java.lang.String name)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XTMSnifferContentHandler

public XTMSnifferContentHandler(XTMTopicMapReader reader,
                                TopicMapStoreFactoryIF store_factory,
                                org.xml.sax.XMLReader parser,
                                LocatorIF base_address)
Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String name,
                         java.lang.String qname,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startElement_

public void startElement_(java.lang.String uri,
                          java.lang.String name,
                          java.lang.String qname,
                          org.xml.sax.Attributes atts)
                   throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String name,
                       java.lang.String qname)
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler

endDocument

public void endDocument()
Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Overrides:
setDocumentLocator in class org.xml.sax.helpers.DefaultHandler

externalEntityDecl

public void externalEntityDecl(java.lang.String name,
                               java.lang.String publicId,
                               java.lang.String systemId)
Specified by:
externalEntityDecl in interface org.xml.sax.ext.DeclHandler

attributeDecl

public void attributeDecl(java.lang.String eName,
                          java.lang.String aName,
                          java.lang.String type,
                          java.lang.String mode,
                          java.lang.String value)
Specified by:
attributeDecl in interface org.xml.sax.ext.DeclHandler

elementDecl

public void elementDecl(java.lang.String name,
                        java.lang.String model)
Specified by:
elementDecl in interface org.xml.sax.ext.DeclHandler

internalEntityDecl

public void internalEntityDecl(java.lang.String name,
                               java.lang.String value)
Specified by:
internalEntityDecl in interface org.xml.sax.ext.DeclHandler

startEntity

public void startEntity(java.lang.String name)
Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler

endEntity

public void endEntity(java.lang.String name)
Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler

comment

public void comment(char[] ch,
                    int start,
                    int length)
Specified by:
comment in interface org.xml.sax.ext.LexicalHandler

startCDATA

public void startCDATA()
Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler

endCDATA

public void endCDATA()
Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler

endDTD

public void endDTD()
Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler

getTopicMaps

public java.util.Collection getTopicMaps()

getXTMVersion

public XTMVersion getXTMVersion()


Copyright © 2000-2012 Ontopia.