org.tm4j.topicmap
Class TopicMapFactoryBase

java.lang.Object
  extended byorg.tm4j.topicmap.TopicMapFactoryBase
All Implemented Interfaces:
TopicMapFactory

public abstract class TopicMapFactoryBase
extends java.lang.Object
implements TopicMapFactory


Field Summary
 
Fields inherited from interface org.tm4j.topicmap.TopicMapFactory
DEFAULT_BASE_URL
 
Constructor Summary
TopicMapFactoryBase(LocatorFactory locFactory, TopicMap tm)
           
 
Method Summary
 Association copy(Association src)
           
 Association copy(Association src, boolean deep)
          Creates a copy of src A deep copy of src returns an Association in which the type and all child Members are deep copied.
 Association copy(Association src, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix)
           
 Association copy(Association src, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix, java.util.HashMap copied)
           
 BaseName copy(BaseName src, Topic destParent)
           
 BaseName copy(BaseName src, Topic destParent, boolean deep)
          Creates a copy of src as a new child of destTopic A deep copy of src returns a BaseName in which the name string is a duplicate of the name string of src and the child Variants are deep copied.
 BaseName copy(BaseName src, Topic destParent, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix)
           
protected  BaseName copy(BaseName src, Topic destParent, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix, java.util.HashMap copied)
           
protected  Locator copy(Locator src)
           
 Member copy(Member src, Association destAssoc)
           
 Member copy(Member src, Association destAssoc, boolean deep)
          Creates a copy of src as a new child of destAssoc A deep copy of src returns a Member in which the roleSpec and players are all deep copied.
 Member copy(Member src, Association destParent, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix)
           
 Occurrence copy(Occurrence src, Topic destParent)
           
 Occurrence copy(Occurrence src, Topic destParent, boolean deep)
          Creates a copy of src as a new child of destTopic A deep copy of src returns an Occurrence in which the type topic is deep copied and the child resourceRef or resourceData is a duplicate of the value in the source object.
 Occurrence copy(Occurrence src, Topic destParent, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix)
           
 Topic copy(Topic src)
           
 Topic copy(Topic src, boolean deep)
          Creates a copy of src.
 Topic copy(Topic src, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix)
          Copies the Topic src.
 Topic copy(Topic src, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix, java.util.HashMap copied)
           
 TopicMap copy(TopicMap src)
          Returns a deep copy of src
 TopicMap copy(TopicMap src, boolean deep)
          Creates a copy of src.
 TopicMap copy(TopicMap src, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix)
          Creates a copy of the topic map src.
 VariantName copy(VariantName src, Variant destParent)
           
 VariantName copy(VariantName src, Variant destParent, boolean deep)
          Creates a copy of src as a new child of destVariant A deep copy of src returns a VariantName in which the child resourceRef or resourceData is a duplicate of the value in the source object.
 VariantName copy(VariantName src, Variant destParent, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix)
           
 Variant copy(Variant src, VariantContainer destParent)
           
 Variant copy(Variant src, VariantContainer destParent, boolean deep)
          Creates a copy of src A deep copy of src returns a Variant in which the child VariantName and Variant objects are deep copied.
 Variant copy(Variant src, VariantContainer destParent, boolean deep, java.lang.String idPrefix, java.lang.String idSuffix)
           
protected  java.lang.String copyID(TopicMapObject src, java.lang.String prefix, java.lang.String suffix)
           
protected  BaseName createBaseName(Topic parent, java.lang.String id, java.lang.String nameString)
           
protected  BaseName createBaseName(Topic parent, java.lang.String id, java.lang.String nameString, Topic[] scope)
           
protected  LocatorFactory getLocatorFactory()
          Makes the internal locator factory object available to derived classes.
abstract  org.apache.commons.logging.Log getLog()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicMapFactoryBase

public TopicMapFactoryBase(LocatorFactory locFactory,
                           TopicMap tm)
Method Detail

getLog

public abstract org.apache.commons.logging.Log getLog()

createBaseName

protected BaseName createBaseName(Topic parent,
                                  java.lang.String id,
                                  java.lang.String nameString)
                           throws DuplicateObjectIDException,
                                  java.beans.PropertyVetoException,
                                  IntegrityViolationException
Throws:
DuplicateObjectIDException
java.beans.PropertyVetoException
IntegrityViolationException

createBaseName

protected BaseName createBaseName(Topic parent,
                                  java.lang.String id,
                                  java.lang.String nameString,
                                  Topic[] scope)
                           throws DuplicateObjectIDException,
                                  java.beans.PropertyVetoException,
                                  IntegrityViolationException
Throws:
DuplicateObjectIDException
java.beans.PropertyVetoException
IntegrityViolationException

copy

public TopicMap copy(TopicMap src)
              throws TopicMapProcessingException,
                     LocatorFactoryException
Description copied from interface: TopicMapFactory
Returns a deep copy of src

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException
See Also:
TopicMapFactory.copy(TopicMap, boolean)

copy

public Topic copy(Topic src)
           throws TopicMapProcessingException,
                  LocatorFactoryException
Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Association copy(Association src)
                 throws TopicMapProcessingException,
                        LocatorFactoryException
Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Member copy(Member src,
                   Association destAssoc)
            throws TopicMapProcessingException,
                   LocatorFactoryException
Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public BaseName copy(BaseName src,
                     Topic destParent)
              throws TopicMapProcessingException,
                     LocatorFactoryException
Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Variant copy(Variant src,
                    VariantContainer destParent)
             throws TopicMapProcessingException,
                    LocatorFactoryException
Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public VariantName copy(VariantName src,
                        Variant destParent)
                 throws TopicMapProcessingException
Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException

copy

public Occurrence copy(Occurrence src,
                       Topic destParent)
                throws TopicMapProcessingException,
                       LocatorFactoryException
Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public TopicMap copy(TopicMap src,
                     boolean deep)
              throws TopicMapProcessingException,
                     LocatorFactoryException
Description copied from interface: TopicMapFactory
Creates a copy of src. A deep copy of src returns a copy in which all contained Topics and Associations are also deep copied. A shallow copy of src returns a TopicMap in which all contained Topics and Associations are shallow copied.

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException
See Also:
TopicMapFactory.copy(Topic, boolean), TopicMapFactory.copy(Association, boolean)

copy

public Topic copy(Topic src,
                  boolean deep)
           throws TopicMapProcessingException,
                  LocatorFactoryException
Description copied from interface: TopicMapFactory
Creates a copy of src. A deep copy of src returns a Topic in which the types and all the child Occurrences and BaseNames are also deep copied. A shallow copy of src returns a Topic which will merge with src. This is achieved by copying the subject of src, or one of its subject indicators or one of its BaseNames If src has none of these characteristics, a TopicMapProcessingException will be thrown.

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Association copy(Association src,
                        boolean deep)
                 throws TopicMapProcessingException,
                        LocatorFactoryException
Description copied from interface: TopicMapFactory
Creates a copy of src A deep copy of src returns an Association in which the type and all child Members are deep copied. A shallow copy of src returns an Association in which the type and child Members are shallow copied.

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException
See Also:
TopicMapFactory.copy(Topic, boolean), TopicMapFactory.copy(Member, Association, boolean)

copy

public Member copy(Member src,
                   Association destAssoc,
                   boolean deep)
            throws TopicMapProcessingException,
                   LocatorFactoryException
Description copied from interface: TopicMapFactory
Creates a copy of src as a new child of destAssoc A deep copy of src returns a Member in which the roleSpec and players are all deep copied. A shallow copy of src returns a Member in which the roleSpec and the players are shallow copied.

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException
See Also:
TopicMapFactory.copy(Topic, boolean)

copy

public BaseName copy(BaseName src,
                     Topic destParent,
                     boolean deep)
              throws TopicMapProcessingException,
                     LocatorFactoryException
Description copied from interface: TopicMapFactory
Creates a copy of src as a new child of destTopic A deep copy of src returns a BaseName in which the name string is a duplicate of the name string of src and the child Variants are deep copied. A shallow copy of src returns a BaseName in which the name string is a reference to the name string of src and the child Variants are shallow copied.

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Variant copy(Variant src,
                    VariantContainer destParent,
                    boolean deep)
             throws TopicMapProcessingException,
                    LocatorFactoryException
Description copied from interface: TopicMapFactory
Creates a copy of src A deep copy of src returns a Variant in which the child VariantName and Variant objects are deep copied. A shallow copy of src returns a Variant in which the child VariantName and Variant objects are shallow copied.

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public VariantName copy(VariantName src,
                        Variant destParent,
                        boolean deep)
                 throws TopicMapProcessingException
Description copied from interface: TopicMapFactory
Creates a copy of src as a new child of destVariant A deep copy of src returns a VariantName in which the child resourceRef or resourceData is a duplicate of the value in the source object. A shallow copy of src returns a VariantName in which the child resourceRef or resourceData is a reference to the value in the source object.

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException

copy

public Occurrence copy(Occurrence src,
                       Topic destParent,
                       boolean deep)
                throws TopicMapProcessingException,
                       LocatorFactoryException
Description copied from interface: TopicMapFactory
Creates a copy of src as a new child of destTopic A deep copy of src returns an Occurrence in which the type topic is deep copied and the child resourceRef or resourceData is a duplicate of the value in the source object. A shallow copy of src returns an Occurrence in which the type topic is shallow copied and the child resourceRef or resourceData is a reference to the value in the source object.

Specified by:
copy in interface TopicMapFactory
Throws:
TopicMapProcessingException
LocatorFactoryException
See Also:
TopicMapFactory.copy(Topic, boolean)

copy

public TopicMap copy(TopicMap src,
                     boolean deep,
                     java.lang.String idPrefix,
                     java.lang.String idSuffix)
              throws TopicMapProcessingException,
                     LocatorFactoryException
Creates a copy of the topic map src. A deep copy forces a copy of all topics and associations in src to be made and the copies are added to the returned TopicMap. A shallow copy populates the returned TopicMap with references to the objects in src.

Parameters:
src - The TopicMap to be copied.
deep - whether or not to do a deep copy.
idPrefix - A string prefix for prepending to the ID property of all copied objects.
idSuffix - A string for appending to the ID property of all copied objects.
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Topic copy(Topic src,
                  boolean deep,
                  java.lang.String idPrefix,
                  java.lang.String idSuffix)
           throws TopicMapProcessingException,
                  LocatorFactoryException
Copies the Topic src. A deep copy makes a deep copy of all child BaseNames and Occurrences. A shallow copy creates a Topic which will merge with src

Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Topic copy(Topic src,
                  boolean deep,
                  java.lang.String idPrefix,
                  java.lang.String idSuffix,
                  java.util.HashMap copied)
           throws TopicMapProcessingException,
                  LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Association copy(Association src,
                        boolean deep,
                        java.lang.String idPrefix,
                        java.lang.String idSuffix)
                 throws TopicMapProcessingException,
                        LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Association copy(Association src,
                        boolean deep,
                        java.lang.String idPrefix,
                        java.lang.String idSuffix,
                        java.util.HashMap copied)
                 throws TopicMapProcessingException,
                        LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Member copy(Member src,
                   Association destParent,
                   boolean deep,
                   java.lang.String idPrefix,
                   java.lang.String idSuffix)
            throws TopicMapProcessingException,
                   LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public BaseName copy(BaseName src,
                     Topic destParent,
                     boolean deep,
                     java.lang.String idPrefix,
                     java.lang.String idSuffix)
              throws TopicMapProcessingException,
                     LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

protected BaseName copy(BaseName src,
                        Topic destParent,
                        boolean deep,
                        java.lang.String idPrefix,
                        java.lang.String idSuffix,
                        java.util.HashMap copied)
                 throws TopicMapProcessingException,
                        LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public Variant copy(Variant src,
                    VariantContainer destParent,
                    boolean deep,
                    java.lang.String idPrefix,
                    java.lang.String idSuffix)
             throws TopicMapProcessingException,
                    LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

copy

public VariantName copy(VariantName src,
                        Variant destParent,
                        boolean deep,
                        java.lang.String idPrefix,
                        java.lang.String idSuffix)
                 throws TopicMapProcessingException
Throws:
TopicMapProcessingException

copy

public Occurrence copy(Occurrence src,
                       Topic destParent,
                       boolean deep,
                       java.lang.String idPrefix,
                       java.lang.String idSuffix)
                throws TopicMapProcessingException,
                       LocatorFactoryException
Throws:
TopicMapProcessingException
LocatorFactoryException

copyID

protected java.lang.String copyID(TopicMapObject src,
                                  java.lang.String prefix,
                                  java.lang.String suffix)

copy

protected Locator copy(Locator src)
                throws LocatorFactoryException
Throws:
LocatorFactoryException

getLocatorFactory

protected LocatorFactory getLocatorFactory()
Makes the internal locator factory object available to derived classes.