|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xml.sax.helpers.DefaultHandler net.ontopia.topicmaps.xml.AbstractTopicMapContentHandler net.ontopia.topicmaps.xml.XTMContentHandler
public class XTMContentHandler
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 | |
---|---|
protected java.util.Map |
entities
Keeps track of the declared entities, in order that the base URI can be set correctly in external entities. |
protected boolean |
isSubDocument
Used to tell if we are reading the top-level XTM document (false) or if we are reading a merged-in XTM document (true). |
protected net.ontopia.topicmaps.xml.XTMContentHandler.LazyTopic |
lazyTopic
|
static LocatorIF |
nullPSI
|
protected ExternalReferenceHandlerIF |
ref_handler
|
protected TopicMapStoreFactoryIF |
stores
|
protected XMLReaderFactoryIF |
xrfactory
|
Fields inherited from class net.ontopia.topicmaps.xml.AbstractTopicMapContentHandler |
---|
doc_address, ehandler, info, locator, parents, processed_documents_accumulated, processed_documents_current, processed_documents_from_parent, propagated_themes |
Constructor Summary | |
---|---|
XTMContentHandler(TopicMapStoreFactoryIF stores,
XMLReaderFactoryIF xrfactory,
LocatorIF base_address)
|
|
XTMContentHandler(TopicMapStoreFactoryIF stores,
XMLReaderFactoryIF xrfactory,
LocatorIF base_address,
java.util.Collection processed_documents)
|
Method Summary | |
---|---|
protected void |
addItemIdentifier(TMObjectIF tmobject,
LocatorIF sourceLocator)
|
protected TopicIF |
addSubjectIdentifier(TopicIF topic,
LocatorIF subjectIndicator)
|
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)
|
protected LocatorIF |
createLocator(java.lang.String address)
|
protected TopicIF |
createTopicFromLazyTopic()
|
protected LocatorIF |
createURILocator(java.lang.String address)
|
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)
|
protected LocatorIF |
getBaseAddress()
|
static TopicIF |
getDefaultOccurrenceTopic(TopicMapIF topicmap)
|
ExternalReferenceHandlerIF |
getExternalReferenceHandler()
INTERNAL: Gets the external reference handler. |
static TopicIF |
getNullTopic(TopicMapIF topicmap)
|
protected TopicIF |
getParentTopic()
|
protected TopicIF |
getReferencedExternalTopic(LocatorIF orig_locator)
|
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)
|
protected void |
processMember(TopicIF player)
|
protected void |
processTheme(TopicIF theme)
|
protected void |
processTopicReference(TopicIF referenced_topic)
|
void |
register(org.xml.sax.XMLReader parser)
INTERNAL: Registers the handler with the parser and configures the parser. |
protected void |
registerSourceLocator(TMObjectIF tmobject,
java.lang.String id)
|
protected TopicIF |
registerSourceLocator(TopicIF topic,
LocatorIF locator)
|
protected TopicIF |
registerSubjectIndicator(TopicIF topic,
LocatorIF locator)
|
protected TopicIF |
registerSubjectLocator(TopicIF topic,
LocatorIF locator)
|
static void |
removeDefaultOccurrenceTopic(TopicMapIF topicmap)
|
static void |
removeNullTopic(TopicMapIF topicmap)
|
protected TopicIF |
resolveResourceRef(LocatorIF locator)
|
protected TopicIF |
resolveSourceLocatorOrSubjectIndicator(LocatorIF locator)
|
protected TopicIF |
resolveTopicRef(java.lang.String address)
|
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 |
---|
getDefaultErrorHandler, getLocationInfo, getPropagatedThemes, propagateThemes, 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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TopicMapStoreFactoryIF stores
protected XMLReaderFactoryIF xrfactory
protected java.util.Map entities
protected boolean isSubDocument
protected ExternalReferenceHandlerIF ref_handler
protected net.ontopia.topicmaps.xml.XTMContentHandler.LazyTopic lazyTopic
public static LocatorIF nullPSI
Constructor Detail |
---|
public XTMContentHandler(TopicMapStoreFactoryIF stores, XMLReaderFactoryIF xrfactory, LocatorIF base_address)
public XTMContentHandler(TopicMapStoreFactoryIF stores, XMLReaderFactoryIF xrfactory, LocatorIF base_address, java.util.Collection processed_documents)
Method Detail |
---|
public java.util.Collection getTopicMaps()
public ExternalReferenceHandlerIF getExternalReferenceHandler()
public void setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler)
public void setSubDocument(boolean isSubDocument)
public void register(org.xml.sax.XMLReader parser)
register
in class AbstractTopicMapContentHandler
public void startDocument()
startDocument
in interface org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
public void endDocument()
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
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
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void characters(char[] ch, int start, int length)
characters
in interface org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
public void endElement(java.lang.String uri, java.lang.String name, java.lang.String qName) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
startPrefixMapping
in interface org.xml.sax.ContentHandler
startPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
public void endPrefixMapping(java.lang.String prefix)
endPrefixMapping
in interface org.xml.sax.ContentHandler
endPrefixMapping
in class org.xml.sax.helpers.DefaultHandler
protected LocatorIF getBaseAddress()
protected TopicIF resolveTopicRef(java.lang.String address) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected TopicIF resolveResourceRef(LocatorIF locator)
protected TopicIF registerSubjectLocator(TopicIF topic, LocatorIF locator)
protected void registerSourceLocator(TMObjectIF tmobject, java.lang.String id)
protected TopicIF registerSourceLocator(TopicIF topic, LocatorIF locator)
protected TopicIF registerSubjectIndicator(TopicIF topic, LocatorIF locator)
protected TopicIF resolveSourceLocatorOrSubjectIndicator(LocatorIF locator)
protected LocatorIF createLocator(java.lang.String address)
protected LocatorIF createURILocator(java.lang.String address)
protected TopicIF getReferencedExternalTopic(LocatorIF orig_locator) throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void processTheme(TopicIF theme)
protected void processTopicReference(TopicIF referenced_topic)
protected void processMember(TopicIF player)
protected void addItemIdentifier(TMObjectIF tmobject, LocatorIF sourceLocator)
protected TopicIF addSubjectIdentifier(TopicIF topic, LocatorIF subjectIndicator)
protected TopicIF getParentTopic()
protected TopicIF createTopicFromLazyTopic()
public void startEntity(java.lang.String name)
startEntity
in interface org.xml.sax.ext.LexicalHandler
public void endEntity(java.lang.String name)
endEntity
in interface org.xml.sax.ext.LexicalHandler
public void comment(char[] ch, int start, int length)
comment
in interface org.xml.sax.ext.LexicalHandler
public void startCDATA()
startCDATA
in interface org.xml.sax.ext.LexicalHandler
public void endCDATA()
endCDATA
in interface org.xml.sax.ext.LexicalHandler
public void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
startDTD
in interface org.xml.sax.ext.LexicalHandler
public void endDTD()
endDTD
in interface org.xml.sax.ext.LexicalHandler
public void externalEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
externalEntityDecl
in interface org.xml.sax.ext.DeclHandler
public void attributeDecl(java.lang.String eName, java.lang.String aName, java.lang.String type, java.lang.String mode, java.lang.String value)
attributeDecl
in interface org.xml.sax.ext.DeclHandler
public void elementDecl(java.lang.String name, java.lang.String model)
elementDecl
in interface org.xml.sax.ext.DeclHandler
public void internalEntityDecl(java.lang.String name, java.lang.String value)
internalEntityDecl
in interface org.xml.sax.ext.DeclHandler
public static TopicIF getNullTopic(TopicMapIF topicmap)
public static TopicIF getDefaultOccurrenceTopic(TopicMapIF topicmap)
public static void removeNullTopic(TopicMapIF topicmap)
public static void removeDefaultOccurrenceTopic(TopicMapIF topicmap)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |