net.ontopia.topicmaps.xml
Class XTMContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by net.ontopia.topicmaps.xml.AbstractTopicMapContentHandler
          extended by net.ontopia.topicmaps.xml.XTMContentHandler
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 XTMContentHandler
extends AbstractTopicMapContentHandler
implements org.xml.sax.ext.LexicalHandler, org.xml.sax.ext.DeclHandler

INTERNAL: SAX2 content handler used for importing XTM 1.0 topic map documents. The content handler builds a topic map object based on a SAX event stream conforming to the XTM topic map interchange syntax. See http://www.topicmaps.org/xtm/1.0/


Field Summary
static LocatorIF nullPSI
           
 
Constructor Summary
XTMContentHandler(TopicMapStoreFactoryIF stores, net.ontopia.xml.XMLReaderFactoryIF xrfactory, LocatorIF base_address)
           
XTMContentHandler(TopicMapStoreFactoryIF stores, net.ontopia.xml.XMLReaderFactoryIF xrfactory, LocatorIF base_address, java.util.Collection processed_documents)
           
 
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 characters(char[] ch, int start, int length)
           
 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 endPrefixMapping(java.lang.String prefix)
           
 void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
           
static TopicIF getDefaultOccurrenceTopic(TopicMapIF topicmap)
           
 ExternalReferenceHandlerIF getExternalReferenceHandler()
          INTERNAL: Gets the external reference handler.
static TopicIF getNullTopic(TopicMapIF topicmap)
           
 java.util.Collection getTopicMaps()
          INTERNAL: Gets the topic maps found after having parsed the input source.
 void internalEntityDecl(java.lang.String name, java.lang.String value)
           
 void register(org.xml.sax.XMLReader parser)
          INTERNAL: Registers the handler with the parser and configures the parser.
static void removeDefaultOccurrenceTopic(TopicMapIF topicmap)
           
static void removeNullTopic(TopicMapIF topicmap)
           
 void setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler)
          INTERNAL: Sets the external reference handler.
 void setSubDocument(boolean isSubDocument)
          INTERNAL: Tell the handler whether this is a top-level document or not.
 void startCDATA()
           
 void startDocument()
           
 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 startEntity(java.lang.String name)
           
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
           
 
Methods inherited from class net.ontopia.topicmaps.xml.AbstractTopicMapContentHandler
getPropagatedThemes, setDocumentLocator, setPropagatedThemes
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nullPSI

public static LocatorIF nullPSI
Constructor Detail

XTMContentHandler

public XTMContentHandler(TopicMapStoreFactoryIF stores,
                         net.ontopia.xml.XMLReaderFactoryIF xrfactory,
                         LocatorIF base_address)

XTMContentHandler

public XTMContentHandler(TopicMapStoreFactoryIF stores,
                         net.ontopia.xml.XMLReaderFactoryIF xrfactory,
                         LocatorIF base_address,
                         java.util.Collection processed_documents)
Method Detail

getTopicMaps

public java.util.Collection getTopicMaps()
INTERNAL: Gets the topic maps found after having parsed the input source.


getExternalReferenceHandler

public ExternalReferenceHandlerIF getExternalReferenceHandler()
INTERNAL: Gets the external reference handler. The reference handler will receive notifications on references to external topics and topic maps.


setExternalReferenceHandler

public void setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler)
INTERNAL: Sets the external reference handler.


setSubDocument

public void setSubDocument(boolean isSubDocument)
INTERNAL: Tell the handler whether this is a top-level document or not.


register

public void register(org.xml.sax.XMLReader parser)
INTERNAL: Registers the handler with the parser and configures the parser.

Overrides:
register in class AbstractTopicMapContentHandler

startDocument

public void startDocument()
Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument 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

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

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler

endElement

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

startPrefixMapping

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

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
endPrefixMapping in class org.xml.sax.helpers.DefaultHandler

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

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

getNullTopic

public static TopicIF getNullTopic(TopicMapIF topicmap)

getDefaultOccurrenceTopic

public static TopicIF getDefaultOccurrenceTopic(TopicMapIF topicmap)

removeNullTopic

public static void removeNullTopic(TopicMapIF topicmap)

removeDefaultOccurrenceTopic

public static void removeDefaultOccurrenceTopic(TopicMapIF topicmap)


Copyright © 2000-2010 Ontopia.