org.tm4j.topicmap.utils
Class XTMBuilder

java.lang.Object
  extended byorg.tm4j.topicmap.utils.XTMBuilder
All Implemented Interfaces:
TopicMapBuilder, TopicMapHandler

public class XTMBuilder
extends java.lang.Object
implements TopicMapHandler, TopicMapBuilder

Implementation of the TopicMapBuilder interface which supports the parsing of topic map information from XML files conforming to the XTM 1.0 DTD and specification.

Properties supported by this implementation are:

http://www.tm4j.org/tm4j/xtmbuilder/validation [XTMBuilder.OPTION_VALIDATION]
Specifies whether parsing should use a validating parser or a non-validating parser. If the value of this property is 'true', then a validating parser will be applied to the input stream, otherwise a non-validating parser will be applied. Default value is 'false'.
http://www.tm4j.org/tm4j/xtmbuilder/failonveto [XTMBuilder.OPTION_FAIL_ON_VETO]
Specifies whether parsing should be abandoned if a PropertyVetoException is encountered while populating the topic map. If the value of this property is 'true', then parsing will be abandoned if such an exception is raised, otherwise the builder will attempt to continue, ignoring the vetoed change. Default value is 'true'

Author:
Kal Ahmed, Harald Kuhn (support for Reader)

Field Summary
static java.lang.String DEFAULT_BASE_URL
           
protected  org.apache.xml.resolver.tools.CatalogResolver m_catalogResolver
           
static java.lang.String OPTION_FAIL_ON_VETO
          A convenience constant defining the property name http://www.tm4j.org/tm4j/xtmbuilder/failonveto If this property is set to true, then the parser will throw an exception if a PropertyVetoException prevents the creation or update of a TopicMapObject.
static java.lang.String OPTION_FULL_XML_BASE
          A constant defining the property name http://www.tm4j.org/tm4j/xtmbuilder/fullxmlbase If this property is set to true, then xml:base attributes will be honoured wherever they appear in the XTM file If this property is set to false, then only the xml:base attribute on the root topicMap element will be honoured.
static java.lang.String OPTION_USE_DEFAULT_CATALOG
          A constant defining the property http://www.tm4j.org/tm4j/xtmbuilder/usedefaultcatalog.
static java.lang.String OPTION_VALIDATION
          A convenience constant defining the property name http://www.tm4j.org/tm4j/xtmbuilder/validation If this property is true, the builder will attempt to locate and use a validating XML parser.
 
Fields inherited from interface org.tm4j.topicmap.utils.TopicMapHandler
REFTYPE_RESOURCE, REFTYPE_SUBJECTINDICATOR, REFTYPE_TOPIC
 
Fields inherited from interface org.tm4j.topicmap.utils.TopicMapBuilder
OPTION_ADDED_THEMES
 
Constructor Summary
XTMBuilder()
          Creates an unitialised XTMBuilder for later initialisation by a call to the build() method.
XTMBuilder(TopicMap baseTM)
          Creates an XTMBuilder using the provided TopicMap, which is used to obtain the TopicMapFactory and LocatorFactory.
XTMBuilder(TopicMapFactory factory, LocatorFactory locFactory)
          Creates an XTMBuilder using the provided TopicMapFactory and LocatorFactory.
XTMBuilder(TopicMap baseTM, Locator mergeMapLocator)
          Creates an XTMBuilder using the provided TopicMap, which is used to obtain the TopicMapFactory and LocatorFactory.
 
Method Summary
protected  void addThemes(ScopedObject sco)
           
protected  java.lang.String assignID(Locator loc)
           
protected  java.lang.String assignID(Locator loc, java.lang.String id)
           
protected  java.lang.String assignID(java.lang.String elementID)
           
 void baseNameString(java.lang.String id, java.lang.String value)
          Indicates a base name string event.
 void build(org.xml.sax.InputSource src, Locator srcLoc, TopicMap tm)
           
 void build(java.io.InputStream src, Locator srcLoc, TopicMap tm)
          Build topic map constructs from the specified source stream.
 void build(java.io.InputStream source, Locator base, TopicMap existing, Topic[] addedThemes)
          Build topic map constructs from the specified source stream.
 void build(java.io.InputStream src, Locator srcLoc, TopicMap tm, TopicMapProvider provider)
          Build topic map constructs from the specified source stream.
 void build(java.io.InputStream src, Locator srcLoc, TopicMap tm, TopicMapProvider provider, Topic[] addedThemes)
           
 void build(java.io.InputStream src, TopicMap tm, TopicMapProvider provider)
           
 void build(java.io.Reader src, Locator srcLoc, TopicMap tm)
          Build topic map constructs from the specified Reader.
 void build(java.io.Reader source, Locator base, TopicMap existing, Topic[] addedThemes)
           
 void build(java.io.Reader src, Locator srcLoc, TopicMap tm, TopicMapProvider provider)
          Build topic map constructs from the specified Reader.
 void build(java.io.Reader source, Locator base, TopicMap existing, TopicMapProvider provider, Topic[] addedThemes)
           
 void endAssociation()
          Indicates the end of an association event.
 void endBaseName()
          Indicates the end of a topic base name event.
 void endInstanceOf()
          Indicates the end of an instanceOf event.
 void endMember()
          Indicates the end of an association member event.
 void endMergeMap()
          Indicates the end of a mergeMap event.
 void endOccurrence()
          Indicates the end of an occurrence event.
 void endParameters()
          Indicates the end of a variant parameters event.
 void endRoleSpec()
          Indicates the end of an association role specification event.
 void endScope()
          Indicates the end of a scope event.
 void endSubjectIdentity()
          Indicates the end of a subject identity event.
 void endTopic()
          Indicates the start of a topic event.
 void endTopicMap()
          Indicates the end of a topic map event.
 void endVariant()
          Indicates the end of a base name variant event.
 void endVariantName()
          Indicates the end of a variant name event.
protected  java.lang.String expandID(java.lang.String id)
           
protected  Locator expandRef(Locator loc, Locator baseLoc)
           
protected  java.lang.String expandRef(java.lang.String ref)
           
protected  java.lang.String expandResourceID(java.lang.String id)
           
 java.lang.String generateID()
           
 org.apache.xml.resolver.tools.CatalogResolver getCatalogResolver()
          Return the CatalogResolver used by this XTMBuilder, null if not available.
 Topic getTopicBySourceLocator(Locator resourceLocator)
           
 Topic getTopicBySubject(Locator resource)
           
 Topic getTopicBySubjectIndicator(java.lang.String indicator)
           
 TopicMap getTopicMap()
          Return the TopicMap built by this XTMBuilder.
protected  void init()
           
 boolean isSupportedProperty(java.lang.String propertyName)
          Determines whether or not a specific property is supported by the TopicMapBuilder implementation.
protected  int peekPurpose()
           
protected  int popPurpose()
           
protected  void pushPurpose(int purpose)
           
 void ref(java.lang.String id, int refType, Locator refValue, Locator base)
          Indicates a reference event.
 void ref(java.lang.String id, int refType, java.lang.String refValue, java.lang.String xmlBase)
          Indicates a reference event.
 void reportWarning(java.lang.String msg)
           
 void resourceData(java.lang.String id, java.lang.String data)
          Indicates a resource data event.
protected  Locator resourceLocatorForID(java.lang.String id)
           
protected  void scopeClassInstanceAssociation(Topic classTopic, Topic instTopic)
           
 void setAddedThemes(Topic[] addedThemes)
          Sets the collection of Topics to be added to the scope of every Association, Occurrence and BaseName built by this class.
 void setProperty(java.lang.String propertyName, java.lang.Object value)
          Set a configuration property for the builder which will be applied to the processing of subsequent invocations of the build() method.
protected  void setResourceID(TopicMapObject tmo, java.lang.String id)
           
 void setResourceURL(java.net.URL url)
          Deprecated. From 0.6.0 use setSourceLocator(org.tm4j.net.Locator) instead.
 void setSourceLocator(Locator loc)
          Set the Locator of the built TopicMap to loc.
 void startAssociation(java.lang.String id)
          Indicates the start of an association event.
 void startBaseName(java.lang.String id)
          Indicates the start of a topic base name event.
 void startInstanceOf(java.lang.String id)
          Indicates the start of an instanceOf event.
 void startMember(java.lang.String id)
          Indicates the start of an association member event.
 void startMergeMap(java.lang.String id, java.lang.String mergeMapURI, java.lang.String base)
          Indicates the start of a mergeMap event.
 void startOccurrence(java.lang.String id)
          Indicates the start of an occurrence event.
 void startParameters(java.lang.String id)
          Indicates the start of a variant parameters event.
 void startRoleSpec(java.lang.String id)
          Indicates the start of an association role specification event.
 void startScope(java.lang.String id)
          Indicates the start of a scope event.
 void startSubjectIdentity(java.lang.String id)
          Indicates the start of a subject identity event.
 void startTopic(java.lang.String id)
          Indicates the start of a topic event.
 void startTopicMap(java.lang.String id, java.lang.String xmlBase)
          Indicates the start of a topic map event.
 void startVariant(java.lang.String id)
          Indicates the start of a base name variant event.
 void startVariantName(java.lang.String id)
          Indicates the start of a variant name event.
 void variantName(java.lang.String id, java.lang.String value)
          Indicates a variant name event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPTION_VALIDATION

public static final java.lang.String OPTION_VALIDATION
A convenience constant defining the property name http://www.tm4j.org/tm4j/xtmbuilder/validation If this property is true, the builder will attempt to locate and use a validating XML parser. If this property is false, the builer will attempt to locate and use a non-validating XML parser. The default value is false

See Also:
Constant Field Values

OPTION_FAIL_ON_VETO

public static final java.lang.String OPTION_FAIL_ON_VETO
A convenience constant defining the property name http://www.tm4j.org/tm4j/xtmbuilder/failonveto If this property is set to true, then the parser will throw an exception if a PropertyVetoException prevents the creation or update of a TopicMapObject. If this property is set to false, then the parser will ignore the failure and continue. The default value is true

See Also:
Constant Field Values

DEFAULT_BASE_URL

public static final java.lang.String DEFAULT_BASE_URL
See Also:
Constant Field Values

OPTION_FULL_XML_BASE

public static final java.lang.String OPTION_FULL_XML_BASE
A constant defining the property name http://www.tm4j.org/tm4j/xtmbuilder/fullxmlbase If this property is set to true, then xml:base attributes will be honoured wherever they appear in the XTM file If this property is set to false, then only the xml:base attribute on the root topicMap element will be honoured. Default setting is false, matching the XTM 1.0 specification.

See Also:
Constant Field Values

OPTION_USE_DEFAULT_CATALOG

public static final java.lang.String OPTION_USE_DEFAULT_CATALOG
A constant defining the property http://www.tm4j.org/tm4j/xtmbuilder/usedefaultcatalog. If this property is set to true, then the XML parser will use a default catalog which resolves the XTM 1.0 PUBLIC identifier "-//TopicMaps.Org//DTD XML Topic Map (XTM) 1.0//EN" and the XTM 1.0 SYSTEM identifier "http://www.topicmaps.org/xtm/1.0/xtm1.dtd" to a copy of the DTD stored in the tm4j.jar file. If there is already a catalog providing locations for either of these identifiers, or if the value of this property is false, then the default catalog is not used.

See Also:
Constant Field Values

m_catalogResolver

protected org.apache.xml.resolver.tools.CatalogResolver m_catalogResolver
Constructor Detail

XTMBuilder

public XTMBuilder()
Creates an unitialised XTMBuilder for later initialisation by a call to the build() method.


XTMBuilder

public XTMBuilder(TopicMapFactory factory,
                  LocatorFactory locFactory)
Creates an XTMBuilder using the provided TopicMapFactory and LocatorFactory.


XTMBuilder

public XTMBuilder(TopicMap baseTM)
Creates an XTMBuilder using the provided TopicMap, which is used to obtain the TopicMapFactory and LocatorFactory.


XTMBuilder

public XTMBuilder(TopicMap baseTM,
                  Locator mergeMapLocator)
Creates an XTMBuilder using the provided TopicMap, which is used to obtain the TopicMapFactory and LocatorFactory. The Locator mergeMapLocator is used as the base URL of generated TopicMaps.

Method Detail

init

protected void init()

isSupportedProperty

public boolean isSupportedProperty(java.lang.String propertyName)
Description copied from interface: TopicMapBuilder
Determines whether or not a specific property is supported by the TopicMapBuilder implementation.

Specified by:
isSupportedProperty in interface TopicMapBuilder
Parameters:
propertyName - the name of the property to check for support.
Returns:
true if the property is supported and false otherwise.

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object value)
                 throws BuilderPropertyNotRecognizedException,
                        BuilderPropertyInvalidException
Description copied from interface: TopicMapBuilder
Set a configuration property for the builder which will be applied to the processing of subsequent invocations of the build() method. A typical use of this method will be to set parser options prior to parsing the input stream.

Specified by:
setProperty in interface TopicMapBuilder
Parameters:
propertyName - the name of the property to be set. See inidividual implementation classes for details of which properties are recognized by each implementation.
value - the value to be applied to the property.
Throws:
BuilderPropertyInvalidException - if value falls outside the supported range of values for the specified property.
BuilderPropertyNotRecognizedException - if propertyName specifies a property which is not supported by the TopicMapBuilder implementation.

build

public void build(java.io.InputStream src,
                  TopicMap tm,
                  TopicMapProvider provider)
           throws java.io.IOException,
                  LocatorFactoryException,
                  TopicMapProcessingException,
                  java.beans.PropertyVetoException,
                  TopicMapProviderException
Throws:
java.io.IOException
LocatorFactoryException
TopicMapProcessingException
java.beans.PropertyVetoException
TopicMapProviderException

build

public void build(java.io.InputStream src,
                  Locator srcLoc,
                  TopicMap tm,
                  TopicMapProvider provider)
           throws java.io.IOException,
                  LocatorFactoryException,
                  java.beans.PropertyVetoException,
                  TopicMapProcessingException,
                  TopicMapProviderException
Deprecated. Use build(TopicMapSource, TopicMap) instead

Description copied from interface: TopicMapBuilder
Build topic map constructs from the specified source stream.

Specified by:
build in interface TopicMapBuilder
Parameters:
src - the source stream to be parsed.
srcLoc - the base address of the source being parsed
tm - the topic map for parsed objects to be added to.
provider - the provider to be used for retrieving any merged topic maps.
Throws:
java.io.IOException
LocatorFactoryException
java.beans.PropertyVetoException
TopicMapProcessingException
TopicMapProviderException

build

public void build(java.io.Reader src,
                  Locator srcLoc,
                  TopicMap tm,
                  TopicMapProvider provider)
           throws java.io.IOException,
                  LocatorFactoryException,
                  java.beans.PropertyVetoException,
                  TopicMapProcessingException,
                  TopicMapProviderException
Deprecated. Use build(TopicMapSource, TopicMap) instead

Description copied from interface: TopicMapBuilder
Build topic map constructs from the specified Reader.

Specified by:
build in interface TopicMapBuilder
Parameters:
src - the Reader to be parsed.
srcLoc - the base address of the source being parsed
tm - the topic map for parsed objects to be added to.
provider - the provider to be used for retrieving any merged topic maps.
Throws:
java.io.IOException
LocatorFactoryException
java.beans.PropertyVetoException
TopicMapProcessingException
TopicMapProviderException

build

public void build(java.io.InputStream src,
                  Locator srcLoc,
                  TopicMap tm)
           throws java.io.IOException,
                  LocatorFactoryException,
                  TopicMapProcessingException,
                  java.beans.PropertyVetoException,
                  TopicMapProviderException
Description copied from interface: TopicMapBuilder
Build topic map constructs from the specified source stream.

Specified by:
build in interface TopicMapBuilder
Parameters:
src - the source stream to be parsed.
srcLoc - the base address of the source being parsed
tm - the topic map for parsed objects to be added to.
Throws:
java.io.IOException
LocatorFactoryException
TopicMapProcessingException
java.beans.PropertyVetoException
TopicMapProviderException

build

public void build(java.io.Reader src,
                  Locator srcLoc,
                  TopicMap tm)
           throws java.io.IOException,
                  LocatorFactoryException,
                  TopicMapProcessingException,
                  java.beans.PropertyVetoException,
                  TopicMapProviderException
Description copied from interface: TopicMapBuilder
Build topic map constructs from the specified Reader.

Specified by:
build in interface TopicMapBuilder
Parameters:
src - the Reader to be parsed.
srcLoc - the base address of the source being parsed
tm - the topic map for parsed objects to be added to.
Throws:
java.io.IOException
LocatorFactoryException
TopicMapProcessingException
java.beans.PropertyVetoException
TopicMapProviderException

build

public void build(org.xml.sax.InputSource src,
                  Locator srcLoc,
                  TopicMap tm)
           throws java.io.IOException,
                  LocatorFactoryException,
                  java.beans.PropertyVetoException,
                  TopicMapProcessingException,
                  TopicMapProviderException
Throws:
java.io.IOException
LocatorFactoryException
java.beans.PropertyVetoException
TopicMapProcessingException
TopicMapProviderException

getTopicMap

public TopicMap getTopicMap()
Return the TopicMap built by this XTMBuilder.


getCatalogResolver

public org.apache.xml.resolver.tools.CatalogResolver getCatalogResolver()
Return the CatalogResolver used by this XTMBuilder, null if not available.


setSourceLocator

public void setSourceLocator(Locator loc)
Set the Locator of the built TopicMap to loc.


setResourceURL

public void setResourceURL(java.net.URL url)
Deprecated. From 0.6.0 use setSourceLocator(org.tm4j.net.Locator) instead.


startTopicMap

public void startTopicMap(java.lang.String id,
                          java.lang.String xmlBase)
                   throws TopicMapProcessingException
Indicates the start of a topic map event.

Specified by:
startTopicMap in interface TopicMapHandler
Throws:
TopicMapProcessingException

endTopicMap

public void endTopicMap()
                 throws TopicMapProcessingException
Indicates the end of a topic map event.

Specified by:
endTopicMap in interface TopicMapHandler
Throws:
TopicMapProcessingException

startTopic

public void startTopic(java.lang.String id)
                throws TopicMapProcessingException
Indicates the start of a topic event.

Specified by:
startTopic in interface TopicMapHandler
Throws:
TopicMapProcessingException

endTopic

public void endTopic()
              throws TopicMapProcessingException
Indicates the start of a topic event.

Specified by:
endTopic in interface TopicMapHandler
Throws:
TopicMapProcessingException

pushPurpose

protected void pushPurpose(int purpose)

peekPurpose

protected int peekPurpose()

popPurpose

protected int popPurpose()

startInstanceOf

public void startInstanceOf(java.lang.String id)
                     throws TopicMapProcessingException
Indicates the start of an instanceOf event.

Specified by:
startInstanceOf in interface TopicMapHandler
Throws:
TopicMapProcessingException

endInstanceOf

public void endInstanceOf()
                   throws TopicMapProcessingException
Indicates the end of an instanceOf event.

Specified by:
endInstanceOf in interface TopicMapHandler
Throws:
TopicMapProcessingException

startSubjectIdentity

public void startSubjectIdentity(java.lang.String id)
                          throws TopicMapProcessingException
Indicates the start of a subject identity event.

Specified by:
startSubjectIdentity in interface TopicMapHandler
Throws:
TopicMapProcessingException

endSubjectIdentity

public void endSubjectIdentity()
                        throws TopicMapProcessingException
Indicates the end of a subject identity event.

Specified by:
endSubjectIdentity in interface TopicMapHandler
Throws:
TopicMapProcessingException

startBaseName

public void startBaseName(java.lang.String id)
                   throws TopicMapProcessingException
Indicates the start of a topic base name event.

Specified by:
startBaseName in interface TopicMapHandler
Throws:
TopicMapProcessingException

endBaseName

public void endBaseName()
                 throws TopicMapProcessingException
Indicates the end of a topic base name event.

Specified by:
endBaseName in interface TopicMapHandler
Throws:
TopicMapProcessingException

startOccurrence

public void startOccurrence(java.lang.String id)
                     throws TopicMapProcessingException
Indicates the start of an occurrence event.

Specified by:
startOccurrence in interface TopicMapHandler
Throws:
TopicMapProcessingException

endOccurrence

public void endOccurrence()
                   throws TopicMapProcessingException
Indicates the end of an occurrence event.

Specified by:
endOccurrence in interface TopicMapHandler
Throws:
TopicMapProcessingException

startAssociation

public void startAssociation(java.lang.String id)
                      throws TopicMapProcessingException
Indicates the start of an association event.

Specified by:
startAssociation in interface TopicMapHandler
Throws:
TopicMapProcessingException

endAssociation

public void endAssociation()
                    throws TopicMapProcessingException
Indicates the end of an association event.

Specified by:
endAssociation in interface TopicMapHandler
Throws:
TopicMapProcessingException

startMember

public void startMember(java.lang.String id)
                 throws TopicMapProcessingException
Indicates the start of an association member event.

Specified by:
startMember in interface TopicMapHandler
Throws:
TopicMapProcessingException

endMember

public void endMember()
               throws TopicMapProcessingException
Indicates the end of an association member event.

Specified by:
endMember in interface TopicMapHandler
Throws:
TopicMapProcessingException

startRoleSpec

public void startRoleSpec(java.lang.String id)
                   throws TopicMapProcessingException
Indicates the start of an association role specification event.

Specified by:
startRoleSpec in interface TopicMapHandler
Throws:
TopicMapProcessingException

endRoleSpec

public void endRoleSpec()
                 throws TopicMapProcessingException
Indicates the end of an association role specification event.

Specified by:
endRoleSpec in interface TopicMapHandler
Throws:
TopicMapProcessingException

startMergeMap

public void startMergeMap(java.lang.String id,
                          java.lang.String mergeMapURI,
                          java.lang.String base)
                   throws TopicMapProcessingException
Indicates the start of a mergeMap event.

Specified by:
startMergeMap in interface TopicMapHandler
Throws:
TopicMapProcessingException

endMergeMap

public void endMergeMap()
                 throws TopicMapProcessingException
Indicates the end of a mergeMap event.

Specified by:
endMergeMap in interface TopicMapHandler
Throws:
TopicMapProcessingException

ref

public void ref(java.lang.String id,
                int refType,
                java.lang.String refValue,
                java.lang.String xmlBase)
         throws TopicMapProcessingException
Indicates a reference event. Type is indicated by refType. The String refValue is a URI reference.

Specified by:
ref in interface TopicMapHandler
Throws:
TopicMapProcessingException

ref

public void ref(java.lang.String id,
                int refType,
                Locator refValue,
                Locator base)
         throws TopicMapProcessingException,
                LocatorFactoryException
Indicates a reference event.

Parameters:
id - the value of the id attribute on the referencing element
refType - the type of reference
refValue - the referenced address
base - the base locator currently in force.
Throws:
TopicMapProcessingException
LocatorFactoryException

resourceData

public void resourceData(java.lang.String id,
                         java.lang.String data)
                  throws TopicMapProcessingException
Indicates a resource data event.

Specified by:
resourceData in interface TopicMapHandler
Throws:
TopicMapProcessingException

startScope

public void startScope(java.lang.String id)
                throws TopicMapProcessingException
Indicates the start of a scope event.

Specified by:
startScope in interface TopicMapHandler
Throws:
TopicMapProcessingException

endScope

public void endScope()
              throws TopicMapProcessingException
Indicates the end of a scope event.

Specified by:
endScope in interface TopicMapHandler
Throws:
TopicMapProcessingException

baseNameString

public void baseNameString(java.lang.String id,
                           java.lang.String value)
                    throws TopicMapProcessingException
Indicates a base name string event.

Specified by:
baseNameString in interface TopicMapHandler
Throws:
TopicMapProcessingException

startVariant

public void startVariant(java.lang.String id)
                  throws TopicMapProcessingException
Indicates the start of a base name variant event.

Specified by:
startVariant in interface TopicMapHandler
Throws:
TopicMapProcessingException

endVariant

public void endVariant()
                throws TopicMapProcessingException
Indicates the end of a base name variant event.

Specified by:
endVariant in interface TopicMapHandler
Throws:
TopicMapProcessingException

startParameters

public void startParameters(java.lang.String id)
                     throws TopicMapProcessingException
Indicates the start of a variant parameters event.

Specified by:
startParameters in interface TopicMapHandler
Throws:
TopicMapProcessingException

endParameters

public void endParameters()
                   throws TopicMapProcessingException
Indicates the end of a variant parameters event.

Specified by:
endParameters in interface TopicMapHandler
Throws:
TopicMapProcessingException

startVariantName

public void startVariantName(java.lang.String id)
                      throws TopicMapProcessingException
Indicates the start of a variant name event.

Specified by:
startVariantName in interface TopicMapHandler
Throws:
TopicMapProcessingException

endVariantName

public void endVariantName()
                    throws TopicMapProcessingException
Indicates the end of a variant name event.

Specified by:
endVariantName in interface TopicMapHandler
Throws:
TopicMapProcessingException

variantName

public void variantName(java.lang.String id,
                        java.lang.String value)
                 throws TopicMapProcessingException
Indicates a variant name event.

Throws:
TopicMapProcessingException

assignID

protected java.lang.String assignID(Locator loc,
                                    java.lang.String id)

assignID

protected java.lang.String assignID(Locator loc)

assignID

protected java.lang.String assignID(java.lang.String elementID)

setResourceID

protected void setResourceID(TopicMapObject tmo,
                             java.lang.String id)
                      throws DuplicateResourceLocatorException
Throws:
DuplicateResourceLocatorException

resourceLocatorForID

protected Locator resourceLocatorForID(java.lang.String id)

expandResourceID

protected java.lang.String expandResourceID(java.lang.String id)

expandID

protected java.lang.String expandID(java.lang.String id)

expandRef

protected java.lang.String expandRef(java.lang.String ref)
                              throws TopicMapProcessingException
Throws:
TopicMapProcessingException

expandRef

protected Locator expandRef(Locator loc,
                            Locator baseLoc)
                     throws TopicMapProcessingException
Throws:
TopicMapProcessingException

getTopicBySourceLocator

public Topic getTopicBySourceLocator(Locator resourceLocator)
                              throws TopicMapProcessingException
Throws:
TopicMapProcessingException

getTopicBySubject

public Topic getTopicBySubject(Locator resource)
                        throws TopicMapProcessingException
Throws:
TopicMapProcessingException

getTopicBySubjectIndicator

public Topic getTopicBySubjectIndicator(java.lang.String indicator)
                                 throws TopicMapProcessingException,
                                        LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

addThemes

protected void addThemes(ScopedObject sco)
                  throws TopicMapProcessingException
Throws:
TopicMapProcessingException

scopeClassInstanceAssociation

protected void scopeClassInstanceAssociation(Topic classTopic,
                                             Topic instTopic)
                                      throws TopicMapProcessingException
Throws:
TopicMapProcessingException

reportWarning

public void reportWarning(java.lang.String msg)

generateID

public java.lang.String generateID()

build

public void build(java.io.InputStream source,
                  Locator base,
                  TopicMap existing,
                  Topic[] addedThemes)
           throws java.io.IOException,
                  LocatorFactoryException,
                  TopicMapProcessingException,
                  java.beans.PropertyVetoException,
                  TopicMapProviderException
Description copied from interface: TopicMapBuilder
Build topic map constructs from the specified source stream.

Specified by:
build in interface TopicMapBuilder
Parameters:
source - the source stream to be parsed.
base - the base address of the source being parsed
existing - the topic map for parsed objects to be added to.
Throws:
java.io.IOException
LocatorFactoryException
TopicMapProcessingException
java.beans.PropertyVetoException
TopicMapProviderException

build

public void build(java.io.Reader source,
                  Locator base,
                  TopicMap existing,
                  Topic[] addedThemes)
           throws java.io.IOException,
                  LocatorFactoryException,
                  TopicMapProcessingException,
                  java.beans.PropertyVetoException,
                  TopicMapProviderException
Specified by:
build in interface TopicMapBuilder
Parameters:
source -
base -
existing -
addedThemes -
Throws:
java.io.IOException
LocatorFactoryException
TopicMapProcessingException
java.beans.PropertyVetoException
TopicMapProviderException

setAddedThemes

public void setAddedThemes(Topic[] addedThemes)
Sets the collection of Topics to be added to the scope of every Association, Occurrence and BaseName built by this class.

Parameters:
addedThemes - an array of the Topics to be added. The topics in this array may be from the TopicMap instance being populated by the builder or from another TopicMap. Any Topic from another TopicMap will first be copied into the TopicMap being populated by the builder. The copy will be a shallow copy (only unscoped names, subject address and subject indicators are copied).

build

public void build(java.io.InputStream src,
                  Locator srcLoc,
                  TopicMap tm,
                  TopicMapProvider provider,
                  Topic[] addedThemes)
           throws java.io.IOException,
                  LocatorFactoryException,
                  TopicMapProcessingException,
                  java.beans.PropertyVetoException,
                  TopicMapProviderException
Specified by:
build in interface TopicMapBuilder
Throws:
java.io.IOException
LocatorFactoryException
TopicMapProcessingException
java.beans.PropertyVetoException
TopicMapProviderException

build

public void build(java.io.Reader source,
                  Locator base,
                  TopicMap existing,
                  TopicMapProvider provider,
                  Topic[] addedThemes)
           throws java.io.IOException,
                  LocatorFactoryException,
                  TopicMapProcessingException,
                  java.beans.PropertyVetoException,
                  TopicMapProviderException
Specified by:
build in interface TopicMapBuilder
Throws:
java.io.IOException
LocatorFactoryException
TopicMapProcessingException
java.beans.PropertyVetoException
TopicMapProviderException