org.tm4j.topicmap.utils
Class SimpleIDMappingStrategy

java.lang.Object
  extended byorg.tm4j.topicmap.utils.SimpleIDMappingStrategy
All Implemented Interfaces:
IDMappingStrategy

public class SimpleIDMappingStrategy
extends java.lang.Object
implements IDMappingStrategy


Field Summary
protected  java.util.HashSet m_mapped
           
 
Constructor Summary
SimpleIDMappingStrategy(TopicMap dest)
           
 
Method Summary
 java.lang.String generateID(java.lang.String sourceID, TopicMap destinationTM)
          This method is invoked to generate an ID for the destination object of a copy.
 java.lang.String getSourceID(java.lang.String destID)
          Returns the ID of the source TopicMapObject which was mapped to destID by the generateID()method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_mapped

protected java.util.HashSet m_mapped
Constructor Detail

SimpleIDMappingStrategy

public SimpleIDMappingStrategy(TopicMap dest)
Method Detail

generateID

public java.lang.String generateID(java.lang.String sourceID,
                                   TopicMap destinationTM)
                            throws TopicMapProcessingException
Description copied from interface: IDMappingStrategy
This method is invoked to generate an ID for the destination object of a copy.

Specified by:
generateID in interface IDMappingStrategy
Parameters:
sourceID - The ID of the source object being copied.
destinationTM - The TopicMap into which the destination object will be copied.
Returns:
The ID to be assigned to the destination object.
Throws:
TopicMapProcessingException - if the mapping cannot be achieved for some reason.

getSourceID

public java.lang.String getSourceID(java.lang.String destID)
Description copied from interface: IDMappingStrategy
Returns the ID of the source TopicMapObject which was mapped to destID by the generateID()method.

Specified by:
getSourceID in interface IDMappingStrategy
Parameters:
destID - The ID of the destination object of the copy
Returns:
The ID of the source object from which the destination ID was generated. Returns null if there is no such mapping.