org.tmapi.core
Class TopicMapSystemFactory

java.lang.Object
  extended byorg.tmapi.core.TopicMapSystemFactory

public abstract class TopicMapSystemFactory
extends java.lang.Object

This factory class provides access to a topic map system. A new TopicMapSystem instance is created by invoking the newTopicMapSystem() method. Configuration properties for the new TopicMapSystem instance can be set by calling the setFeature() and/or setProperty() methods prior to invoking newTopicMapSystem().


Constructor Summary
TopicMapSystemFactory()
           
 
Method Summary
abstract  boolean getFeature(java.lang.String featureName)
          Returns the particular feature requested for in the underlying implementation of TopicMapSystem.
abstract  java.lang.String getProperty(java.lang.String propertyName)
          Gets the value of a property in the underlying implementation of TopicMapSystem.
abstract  boolean hasFeature(java.lang.String featureName)
          Returns if the particular feature is supported by the TopicMapSystem.
static TopicMapSystemFactory newInstance()
          Obtain a new instance of a TopicMapSystemFactory.
abstract  TopicMapSystem newTopicMapSystem()
          Creates a new TopicMapSystem instance using the currently configured factory parameters.
abstract  void setFeature(java.lang.String featureName, boolean value)
          Sets a particular feature in the underlying implementation of TopicMapSystem.
abstract  void setProperties(java.util.Properties props)
          Sets the properties in the underlying implementation of TopicMapSystem.
abstract  void setProperty(java.lang.String propertyName, java.lang.String value)
          Sets a property in the underlying implementation of TopicMapSystem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicMapSystemFactory

public TopicMapSystemFactory()
Method Detail

newTopicMapSystem

public abstract TopicMapSystem newTopicMapSystem()
                                          throws TMAPIException
Creates a new TopicMapSystem instance using the currently configured factory parameters.

Returns:
a new instance of a TopicMapSystem
Throws:
TMAPIException - if a TopicMapSystem cannot be created which satisfies the requested configuration.

newInstance

public static TopicMapSystemFactory newInstance()
                                         throws FactoryConfigurationException
Obtain a new instance of a TopicMapSystemFactory. This static method creates a new factory instance. This method uses the following ordered lookup procedure to determine the TopicMapSystemFactory implementation class to load:

Once an application has obtained a reference to a TopicMapSystemFactory it can use the factory to configure and obtain TopicMapSystem instances.

Returns:
a new instance of TopicMapSystemFactory
Throws:
FactoryConfigurationException

hasFeature

public abstract boolean hasFeature(java.lang.String featureName)
Returns if the particular feature is supported by the TopicMapSystem. Opposite to #getFeature this method returns if the requested feature is generally available / supported by the underlying TopicMapSystem and does not return the state (enabled/disabled) of the feature.

Parameters:
featureName - the name of the feature to check
Returns:
true if the requested feature is supported, otherwise false

getFeature

public abstract boolean getFeature(java.lang.String featureName)
                            throws FeatureNotRecognizedException
Returns the particular feature requested for in the underlying implementation of TopicMapSystem.

Parameters:
featureName - the name of the feature to check
Returns:
true if the named feature is enabled for TopicMapSystem instances created by this factory; false if the named feature is disabled for TopicMapSystem instances created by this factory.
Throws:
FeatureNotRecognizedException - if the underlying implementation does not recongnize the named feature.

setFeature

public abstract void setFeature(java.lang.String featureName,
                                boolean value)
                         throws FeatureNotSupportedException,
                                FeatureNotRecognizedException
Sets a particular feature in the underlying implementation of TopicMapSystem. A list of the core features can be found at http://tmapi.org/features/

Parameters:
featureName - the name of the feature to be set
value - true to enable the feature, false to disable it
Throws:
FeatureNotRecognizedException - if the underlying implementation does not recongnize the named feature.
FeatureNotSupportedException - if the underlying implementation recongnizes the named feature but does not support enabling or disabling it (as specified by the value parameter.

getProperty

public abstract java.lang.String getProperty(java.lang.String propertyName)
Gets the value of a property in the underlying implementation of TopicMapSystem. A list of the core properties defined by TMAPI can be found at http://tmapi.org/properties/. An implementation is free to support properties other than the core ones.

Parameters:
propertyName - the name of the property to retrieve.
Returns:
the value set for this property or null if no value is currently set for the property.

setProperty

public abstract void setProperty(java.lang.String propertyName,
                                 java.lang.String value)
Sets a property in the underlying implementation of TopicMapSystem. A list of the core properties defined by TMAPI can be found at http://tmapi.org/properties/. An implementation is free to support properties other than the core ones.

Parameters:
propertyName - the name of the property to be set
value - the value to be set of this property or null to remove the property from the current factory configuration.

setProperties

public abstract void setProperties(java.util.Properties props)
Sets the properties in the underlying implementation of TopicMapSystem.

Parameters:
props - The properties to be used to initialise the system.
See Also:
setProperty(java.lang.String, java.lang.String)