org.tmapi.core
Class DuplicateSourceLocatorException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.tmapi.core.TMAPIRuntimeException
                  extended byorg.tmapi.core.DuplicateSourceLocatorException
All Implemented Interfaces:
java.io.Serializable

public class DuplicateSourceLocatorException
extends TMAPIRuntimeException

Exception is raised when a source locator is added to a TopicMapObject, that already exists in this TopicMap. It is not thrown when both TopicMapObjects are instance of Topic. In this case a TopicsMustMerge Exception is thrown only in TMAPI implementations, that do not support the "Automatic Merging" feature ( http://tmapi.org/features/automerge). If the implementation does support automatic merging, then the merge should take place transparently to the API user.

See Also:
Serialized Form

Constructor Summary
DuplicateSourceLocatorException(TopicMapObject modified, TopicMapObject unmodified, Locator duplicateSourceLocator, java.lang.String msg)
          Creates a new DuplicateSourceLocatorException with the specified message
 
Method Summary
 TopicMapObject getModifiedTopicMapObject()
          Returns the TopicMapObject to which the duplicate source locator was given.
 Locator getSourceLocator()
          Returns the duplicate source locator
 TopicMapObject getUnmodifiedTopicMapObject()
          Returns the TopicMapObject, which already had the duplicated source locator.
 
Methods inherited from class org.tmapi.core.TMAPIRuntimeException
getCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DuplicateSourceLocatorException

public DuplicateSourceLocatorException(TopicMapObject modified,
                                       TopicMapObject unmodified,
                                       Locator duplicateSourceLocator,
                                       java.lang.String msg)
Creates a new DuplicateSourceLocatorException with the specified message

Parameters:
modified - the TopicMapObject to which the source locator is given
unmodified - the TopicMapObject which already had this source locator
duplicateSourceLocator - the source locator which has been duplicated.
msg - the message to be displayed for this exception
Method Detail

getModifiedTopicMapObject

public TopicMapObject getModifiedTopicMapObject()
Returns the TopicMapObject to which the duplicate source locator was given.

Returns:
a TopicMapObject instance

getUnmodifiedTopicMapObject

public TopicMapObject getUnmodifiedTopicMapObject()
Returns the TopicMapObject, which already had the duplicated source locator.

Returns:
a TopicMapObject instance

getSourceLocator

public Locator getSourceLocator()
Returns the duplicate source locator

Returns:
a Locator instance