|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.tm.TopicMapBuilderFactoryImpl
public class TopicMapBuilderFactoryImpl
A singleton factory class implementing TopicMapBuilderFactory
for creating a TopicMapBuilder instances, delegating builder/managers for TMAPI,
native TM4J (or theoretically other) TopicMap objects.
Supplied with a URI as the Locator address, it provides a builder that, like an event listener/handler, then receives simplified "events" (whose parameters are entirely text strings) that creates Topics, Associations and other TopicMap objects for the TopicMap associated with that builder. This is designed to simplify creation of a TopicMap from the parsing of external source material; not all TopicMap features are supported.
The implementing class is set by the System property
TopicMapBuilderFactory.PROPERTY_BUILDER_CLASS (whose String value
is "org.ceryle.tm.topicmapbuilder"). The property value should contain the
full class name of the implementing class. There are currently two available
implementations:
System.setProperty(TopicMapBuilderFactory.PROPERTY_BUILDER_CLASS,
"org.ceryle.tm.TM4JTopicMapBuilderImpl");
System.setProperty(TopicMapBuilderFactory.PROPERTY_BUILDER_CLASS,
"org.ceryle.tm.TMAPITopicMapBuilderImpl");
The factory provides a TopicMapBuilder object used to create and manage object
creation for a single TopicMap, referenced by its base URI. The builder manages
the creation and access to the objects of that TopicMap.
The getTopicMapBuilder(Object) method is guaranteed to return the same
TopicMapBuilder object when provided with a Locator, File, URL, String, or
Object.toString() reference that resolves to the same String
(as a URI).
To obtain the instance of this class using its default properties:
TopicMapBuilderFactory factory = TopicMapBuilderFactoryImpl.getInstance();
or, if you want to preset any of the TMAPI TopicMapSystem properties:
Properties props = new Properties();
// set properties...
TopicMapBuilderFactory factory = TopicMapBuilderFactoryImpl.getInstance(props);
To obtain the instance of a TopicMapBuilder once you have a factory:
Object o = ...;
TopicMapBuilder builder = factory.getTopicMapBuilder(o);
The Object can be a File, URL, String (in the form of a URI), or any Object whose toString() method returns a String in the form of a URI. You can also use the factory to do a reverse lookup, where providing it with a TopicMap as the parameter returns the existing TopicMapBuilder for that TopicMap, null if one doesn't already exist.
TopicMapBuilder| Field Summary | |
|---|---|
static Object |
ALL_TOPICMAPS
|
| Fields inherited from interface org.ceryle.tm.TopicMapBuilderFactory |
|---|
PROPERTY_BUILDER_CLASS |
| Method Summary | |
|---|---|
static TopicMapBuilderFactory |
getInstance()
As this is a singleton class, this returns the single instance of this class. |
TopicMapBuilder |
getTopicMapBuilder(Object identifier)
Returns either a new or existing TopicMapBuilder for a TopicMap whose base URI is provided by the Object identifier, which can be a File, a URL, TMAPI Locator, String, or any Object whose toString() method returns a String that conforms to the specification of a URI. |
boolean |
removeTopicMapBuilder(Object identifier)
Using the same identification approach as getTopicMapBuilder(Object),
removes the identified TopicMapBuilder from the internal builder cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Object ALL_TOPICMAPS
| Method Detail |
|---|
public static TopicMapBuilderFactory getInstance()
throws TopicMapException
TopicMapException - if the factory cannot be created.
public TopicMapBuilder getTopicMapBuilder(Object identifier)
throws TopicMapException
getTopicMapBuilder in interface TopicMapBuilderFactoryidentifier - the base URI of the TopicMap as a File, URL, Locator,
String, or Object; or, for a reverse lookup, a TopicMap.
TopicMapException
public boolean removeTopicMapBuilder(Object identifier)
throws TopicMapException
getTopicMapBuilder(Object),
removes the identified TopicMapBuilder from the internal builder cache.
If the supplied Object is the special case of ALL_TOPICMAPS, this
will clear the entire cache.
removeTopicMapBuilder in interface TopicMapBuilderFactoryidentifier - the base URI of the TopicMap as a File, URL, Locator,
String, or Object; or the TopicMap itself.
TopicMapException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||