public class XTMContentHandler extends AbstractTopicMapContentHandler implements LexicalHandler, DeclHandler
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
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).
|
static String |
NS_NS |
static String |
NS_XLINK |
static String |
NS_XTM |
static LocatorIF |
nullPSI |
protected ExternalReferenceHandlerIF |
ref_handler |
static String |
SAX_DECL_HANDLER |
static String |
SAX_LEXICAL_HANDLER |
protected TopicMapStoreFactoryIF |
stores |
doc_address, ehandler, info, locator, parents, processed_documents_accumulated, processed_documents_current, processed_documents_from_parent, propagated_themes| Constructor and Description |
|---|
XTMContentHandler(TopicMapStoreFactoryIF stores,
LocatorIF base_address) |
XTMContentHandler(TopicMapStoreFactoryIF stores,
LocatorIF base_address,
Collection<LocatorIF> processed_documents) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addItemIdentifier(TMObjectIF tmobject,
LocatorIF sourceLocator) |
protected TopicIF |
addSubjectIdentifier(TopicIF topic,
LocatorIF subjectIndicator) |
void |
attributeDecl(String eName,
String aName,
String type,
String mode,
String value) |
void |
characters(char[] ch,
int start,
int length) |
void |
comment(char[] ch,
int start,
int length) |
protected LocatorIF |
createLocator(String address) |
protected TopicIF |
createTopicFromLazyTopic() |
protected LocatorIF |
createURILocator(String address) |
void |
elementDecl(String name,
String model) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String uri,
String name,
String qName) |
void |
endEntity(String name) |
void |
endPrefixMapping(String prefix) |
void |
externalEntityDecl(String name,
String publicId,
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) |
Collection<TopicMapIF> |
getTopicMaps()
INTERNAL: Gets the topic maps found after having parsed the input source.
|
void |
internalEntityDecl(String name,
String value) |
protected void |
processMember(TopicIF player) |
protected void |
processTheme(TopicIF theme) |
protected void |
processTopicReference(TopicIF referenced_topic) |
void |
register(XMLReader parser)
INTERNAL: Registers the handler with the parser and configures the
parser.
|
protected void |
registerSourceLocator(TMObjectIF tmobject,
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(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(String name,
String publicId,
String systemId) |
void |
startElement(String uri,
String name,
String qName,
Attributes atts) |
void |
startEntity(String name) |
void |
startPrefixMapping(String prefix,
String uri) |
getDefaultErrorHandler, getLocationInfo, getPropagatedThemes, propagateThemes, setDocumentLocator, setPropagatedThemeserror, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, unparsedEntityDecl, warningpublic static final String NS_XTM
public static final String NS_XLINK
public static final String NS_NS
public static final LocatorIF nullPSI
public static final String SAX_LEXICAL_HANDLER
public static final String SAX_DECL_HANDLER
protected TopicMapStoreFactoryIF stores
protected Map<String,String> entities
protected boolean isSubDocument
protected ExternalReferenceHandlerIF ref_handler
public XTMContentHandler(TopicMapStoreFactoryIF stores, LocatorIF base_address)
public XTMContentHandler(TopicMapStoreFactoryIF stores, LocatorIF base_address, Collection<LocatorIF> processed_documents)
public Collection<TopicMapIF> getTopicMaps()
public ExternalReferenceHandlerIF getExternalReferenceHandler()
public void setExternalReferenceHandler(ExternalReferenceHandlerIF ref_handler)
public void setSubDocument(boolean isSubDocument)
public void register(XMLReader parser)
register in class AbstractTopicMapContentHandlerpublic void startDocument()
startDocument in interface ContentHandlerstartDocument in class DefaultHandlerpublic void endDocument()
endDocument in interface ContentHandlerendDocument in class DefaultHandlerpublic void startElement(String uri, String name, String qName, Attributes atts) throws SAXException
startElement in interface ContentHandlerstartElement in class DefaultHandlerSAXExceptionpublic void characters(char[] ch,
int start,
int length)
characters in interface ContentHandlercharacters in class DefaultHandlerpublic void endElement(String uri, String name, String qName) throws SAXException
endElement in interface ContentHandlerendElement in class DefaultHandlerSAXExceptionpublic void startPrefixMapping(String prefix, String uri)
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class DefaultHandlerpublic void endPrefixMapping(String prefix)
endPrefixMapping in interface ContentHandlerendPrefixMapping in class DefaultHandlerprotected LocatorIF getBaseAddress()
protected TopicIF resolveTopicRef(String address) throws SAXException
SAXExceptionprotected void registerSourceLocator(TMObjectIF tmobject, String id)
protected TopicIF registerSubjectIndicator(TopicIF topic, LocatorIF locator)
protected TopicIF resolveSourceLocatorOrSubjectIndicator(LocatorIF locator)
protected TopicIF getReferencedExternalTopic(LocatorIF orig_locator) throws SAXException
SAXExceptionprotected 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(String name)
startEntity in interface LexicalHandlerpublic void endEntity(String name)
endEntity in interface LexicalHandlerpublic void comment(char[] ch,
int start,
int length)
comment in interface LexicalHandlerpublic void startCDATA()
startCDATA in interface LexicalHandlerpublic void endCDATA()
endCDATA in interface LexicalHandlerpublic void startDTD(String name, String publicId, String systemId)
startDTD in interface LexicalHandlerpublic void endDTD()
endDTD in interface LexicalHandlerpublic void externalEntityDecl(String name, String publicId, String systemId)
externalEntityDecl in interface DeclHandlerpublic void attributeDecl(String eName, String aName, String type, String mode, String value)
attributeDecl in interface DeclHandlerpublic void elementDecl(String name, String model)
elementDecl in interface DeclHandlerpublic void internalEntityDecl(String name, String value)
internalEntityDecl in interface DeclHandlerpublic static TopicIF getNullTopic(TopicMapIF topicmap)
public static TopicIF getDefaultOccurrenceTopic(TopicMapIF topicmap)
public static void removeNullTopic(TopicMapIF topicmap)
public static void removeDefaultOccurrenceTopic(TopicMapIF topicmap)