net.ontopia.topicmaps.entry
Class DefaultTopicMapSource

java.lang.Object
  extended by net.ontopia.topicmaps.entry.DefaultTopicMapSource
All Implemented Interfaces:
TopicMapSourceIF

public class DefaultTopicMapSource
extends java.lang.Object
implements TopicMapSourceIF

INTERNAL: A convenience class that that maintains an arbitrary collection of topic map references. References that are registered with the source gets its source overridden. When a reference is removed its source is set to null.


Field Summary
protected  boolean hidden
           
protected  java.lang.String id
           
protected  java.util.Collection<TopicMapReferenceIF> refs
           
protected  java.lang.String title
           
 
Constructor Summary
DefaultTopicMapSource()
           
DefaultTopicMapSource(java.util.Collection<TopicMapReferenceIF> refs)
           
DefaultTopicMapSource(TopicMapReferenceIF reference)
           
 
Method Summary
 void addReference(TopicMapReferenceIF reference)
          INTERNAL: Adds the reference to the source and registers the source as the source of the reference.
 TopicMapReferenceIF createTopicMap(java.lang.String name, java.lang.String baseAddress)
          PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map.
 boolean getHidden()
           
 java.lang.String getId()
          PUBLIC: Gets the id of the source.
 java.util.Collection<TopicMapReferenceIF> getReferences()
          PUBLIC: Returns an unmodifiable collection of TopicMapReferenceIFs found by the topic map source.
 java.lang.String getTitle()
          PUBLIC: Gets the title of the source.
 void refresh()
          PUBLIC: Refreshes the collection of references.
 void removeReference(TopicMapReferenceIF reference)
          INTERNAL: Removes the reference from the source and deregisters the source from the reference.
 void setHidden(boolean hidden)
           
 void setId(java.lang.String id)
          PUBLIC: Sets the id of the source.
 void setTitle(java.lang.String title)
          PUBLIC: Sets the title of the source.
 boolean supportsCreate()
          PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.
 boolean supportsDelete()
          PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.String id

title

protected java.lang.String title

hidden

protected boolean hidden

refs

protected java.util.Collection<TopicMapReferenceIF> refs
Constructor Detail

DefaultTopicMapSource

public DefaultTopicMapSource()

DefaultTopicMapSource

public DefaultTopicMapSource(java.util.Collection<TopicMapReferenceIF> refs)

DefaultTopicMapSource

public DefaultTopicMapSource(TopicMapReferenceIF reference)
Method Detail

getId

public java.lang.String getId()
Description copied from interface: TopicMapSourceIF
PUBLIC: Gets the id of the source.

Specified by:
getId in interface TopicMapSourceIF

setId

public void setId(java.lang.String id)
Description copied from interface: TopicMapSourceIF
PUBLIC: Sets the id of the source. Note that this method is intended for use when the source is used in a TopicMapRepositoryIF. The source should throw an UnsupportedOperationException if it does not support setting the id.

Specified by:
setId in interface TopicMapSourceIF

getTitle

public java.lang.String getTitle()
Description copied from interface: TopicMapSourceIF
PUBLIC: Gets the title of the source.

Specified by:
getTitle in interface TopicMapSourceIF

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: TopicMapSourceIF
PUBLIC: Sets the title of the source.

Specified by:
setTitle in interface TopicMapSourceIF

getReferences

public java.util.Collection<TopicMapReferenceIF> getReferences()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns an unmodifiable collection of TopicMapReferenceIFs found by the topic map source.

Specified by:
getReferences in interface TopicMapSourceIF

refresh

public void refresh()
Description copied from interface: TopicMapSourceIF
PUBLIC: Refreshes the collection of references. This lets the source look at its underlying data source to reflect any changes made since the last refresh.

Specified by:
refresh in interface TopicMapSourceIF

addReference

public void addReference(TopicMapReferenceIF reference)
INTERNAL: Adds the reference to the source and registers the source as the source of the reference.

Since:
1.3.2

removeReference

public void removeReference(TopicMapReferenceIF reference)
INTERNAL: Removes the reference from the source and deregisters the source from the reference.

Since:
1.3.2

supportsCreate

public boolean supportsCreate()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns true if the source supports creating new topic maps with the createTopicMap.

Specified by:
supportsCreate in interface TopicMapSourceIF

supportsDelete

public boolean supportsDelete()
Description copied from interface: TopicMapSourceIF
PUBLIC: Returns true if the source supports deleting topic map with the TopicMapReferenceIF.delete() method.

Specified by:
supportsDelete in interface TopicMapSourceIF

createTopicMap

public TopicMapReferenceIF createTopicMap(java.lang.String name,
                                          java.lang.String baseAddress)
Description copied from interface: TopicMapSourceIF
PUBLIC: Creates a new topic map in the underlying source and returns a reference to the created topic map. The method takes a name and the base address for the topic map to create.

Specified by:
createTopicMap in interface TopicMapSourceIF

getHidden

public boolean getHidden()

setHidden

public void setHidden(boolean hidden)


Copyright © 2000-2012 Ontopia.