org.tm4j.topicmap.source
Interface TopicMapSource

All Known Implementing Classes:
SerializedTopicMapSource

public interface TopicMapSource

A abstract representation for the source of a TopicMap. When added to a TopicMapProvider, the getLocator and propulateTopicMap methods will be called. Implementations must ensure that a correct Locator for the TopicMap is returned. The TopicMap object passed by populateTopicMap is either a new or an existing TopicMap managed by the calling TopicMapProvider. The TopicMapProvider has to ensure that no null value is passed. What is done with the passed TopicMap object is up to concrete implementations of this interface

Author:
Harald Kuhn

Method Summary
 java.lang.String getBaseAddress()
          Returns the base address of this source.
 Locator getBaseLocator()
          Returns the base locator for this source.
 void populateTopicMap(TopicMap map)
          a callback method called by the TopicMapProvider implementation to populate the topic map
 void populateTopicMap(TopicMap map, Topic[] addedThemes)
           
 void populateTopicMap(TopicMap map, TopicMapProvider provider)
          A callback method called by the TopicMapProvider implementation to populate the topic map.
 void populateTopicMap(TopicMap map, TopicMapProvider provider, Topic[] addedThemes)
           
 

Method Detail

getBaseAddress

public java.lang.String getBaseAddress()
Returns the base address of this source.

Returns:
the base address of the source, as a String

getBaseLocator

public Locator getBaseLocator()
Returns the base locator for this source.

Returns:
the base locator specified for this source as a Locator object, or null if no explicit base locator was provided in the source constructor.

populateTopicMap

public void populateTopicMap(TopicMap map)
                      throws TopicMapProcessingException
a callback method called by the TopicMapProvider implementation to populate the topic map

Parameters:
map - the TopicMap instance to be populated
Throws:
TopicMapProcessingException - if the parsing of the topic map source fails or if during population of the topic map some consistency constraints or XTM rules are violated.

populateTopicMap

public void populateTopicMap(TopicMap map,
                             TopicMapProvider provider)
                      throws TopicMapProcessingException
A callback method called by the TopicMapProvider implementation to populate the topic map. This method allows the provider to give a reference to itself to the callback method and is provided because the TopicMap.getProvider() method cannot be easily implemented on the Ozone backend.

Parameters:
map - the TopicMap instance to be populated
provider - the TopicMapProvider instance that manages map
Throws:
TopicMapProcessingException

populateTopicMap

public void populateTopicMap(TopicMap map,
                             Topic[] addedThemes)
                      throws TopicMapProcessingException
Throws:
TopicMapProcessingException

populateTopicMap

public void populateTopicMap(TopicMap map,
                             TopicMapProvider provider,
                             Topic[] addedThemes)
                      throws TopicMapProcessingException
Throws:
TopicMapProcessingException