org.tm4j.topicmap
Interface DataObject

All Known Subinterfaces:
Occurrence, VariantName
All Known Implementing Classes:
UnifiedOccurrence

public interface DataObject

Base interface for interfaces which represent topic map elements containing character data or remote resource references. In XTM, occurrences and variant names may contain resource data, which can be one of the following:

This interface defines the basic methods for retrieving and manipulating resource data of both these kinds.

Since:
0.6.0
Author:
Kal Ahmed

Method Summary
 java.lang.String getData()
          Gets the resource data string associated with this occurrence.
 Locator getDataLocator()
          Returns the Locator of the resource referenced by this data object.
 boolean isDataInline()
          Determines the type of resource data provided by this data object.
 void setData(java.lang.String data)
          Sets the resource data string associated with this data object.
 void setDataLocator(Locator loc)
          Sets the Locator of the resource referenced by this data object.
 

Method Detail

getDataLocator

public Locator getDataLocator()
Returns the Locator of the resource referenced by this data object. If the data object provides inline data, this method will return null.

Returns:
The resource locator, or null if this data object provides inline character data.

setDataLocator

public void setDataLocator(Locator loc)
                    throws java.beans.PropertyVetoException
Sets the Locator of the resource referenced by this data object. The new value overwrites any previous resource locator or data string.

Parameters:
loc - the resource locator.
Throws:
java.beans.PropertyVetoException - if the change to the data object is vetoed by a listener.

setData

public void setData(java.lang.String data)
             throws java.beans.PropertyVetoException
Sets the resource data string associated with this data object. The new value overwrites any previous data strings or resource locators.

Parameters:
data - the character data to be provided by this data object.
Throws:
java.beans.PropertyVetoException - if the change to the data object is vetoed by a listener.

getData

public java.lang.String getData()
Gets the resource data string associated with this occurrence. This function returns null if there is no resource data string associated with this occurrence.

Returns:
The resource data string, or null if this data object provides a resource reference.

isDataInline

public boolean isDataInline()
Determines the type of resource data provided by this data object.

Returns:
true if this data object provides inline character data, false if it refers to a remote resource.