org.tmapi.core
Class TopicMapSystemFactory

java.lang.Object
  extended by org.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(String, boolean) and / or setProperty(String, Object) methods prior to invoking newTopicMapSystem().

Version:
$Rev: 155 $ - $Date: 2010-02-27 19:46:28 +0100 (Sa, 27 Feb 2010) $
Author:
The TMAPI Project

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.Object 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 enable)
          Sets a particular feature in the underlying implementation of TopicMapSystem.
abstract  void setProperty(java.lang.String propertyName, java.lang.Object 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

hasFeature

public abstract boolean hasFeature(java.lang.String featureName)
Returns if the particular feature is supported by the TopicMapSystem.

Opposite to getFeature(java.lang.String) 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 recognize the named feature.

setFeature

public abstract void setFeature(java.lang.String featureName,
                                boolean enable)
                         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.
enable - true to enable the feature, false to disable it.
Throws:
FeatureNotRecognizedException - If the underlying implementation does not recognize the named feature.
FeatureNotSupportedException - If the underlying implementation recognizes the named feature but does not support enabling or disabling it (as specified by the enabled parameter.

getProperty

public abstract java.lang.Object 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.Object 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.

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