Package net.ontopia.topicmaps.core
Interface VariantNameIF
-
- All Superinterfaces:
NameIF
,ReifiableIF
,ScopedIF
,TMObjectIF
- All Known Subinterfaces:
MVariantName
- All Known Implementing Classes:
ReadOnlyVariantName
,SnapshotVariantName
,VariantName
,VariantName
public interface VariantNameIF extends NameIF, ScopedIF, ReifiableIF
PUBLIC: Implemented by objects representing variant names for topics. Corresponds to 'variant' elements in the XTM 1.0 syntax; a variant name may belong directly to a topic name, or indirectly via another variant name. A variant name either has a literal value (represented directly by thevalue
property, handled using TopicNameIF methods, and correponding to the contents of the 'variantName / resourceData' element in XTM 1.0) or a locator which identifies a resource (corresponding to a 'variantName' element with a 'resourceRef' child element in XTM 1.0). If a locator is present, the value property isnull
, and the locator of the resource appears in the locator property of the variantName.
-
-
Field Summary
Fields Modifier and Type Field Description static String
EVENT_ADD_THEME
static String
EVENT_ADDED
static String
EVENT_REMOVE_THEME
static String
EVENT_REMOVED
static String
EVENT_SET_DATATYPE
static String
EVENT_SET_VALUE
-
Fields inherited from interface net.ontopia.topicmaps.core.ReifiableIF
EVENT_SET_REIFIER
-
Fields inherited from interface net.ontopia.topicmaps.core.TMObjectIF
EVENT_ADD_ITEMIDENTIFIER, EVENT_REMOVE_ITEMIDENTIFIER, MSG_NULL_ARGUMENT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description LocatorIF
getDataType()
PUBLIC: Gets the data type of this variant.long
getLength()
PUBLIC: Returns the length of the variant value.default LocatorIF
getLocator()
PUBLIC: Returns a LocatorIF representation of the variant value.Reader
getReader()
PUBLIC: Returns a Reader that allows you to stream the string representation of this variant.TopicNameIF
getTopicName()
PUBLIC: Gets the topic name to which this variant name belongs.String
getValue()
PUBLIC: Gets the string representation of this variant.default void
setLocator(LocatorIF locator)
PUBLIC: Same assetValue(locator.getAddress(), DataTypes.TYPE_URI)
.void
setReader(Reader value, long length, LocatorIF datatype)
PUBLIC: Sets the value and the data type of this variant using a reader.default void
setValue(String value)
PUBLIC: Same assetValue(value, DataTypes.TYPE_STRING)
.void
setValue(String value, LocatorIF datatype)
PUBLIC: Sets the value and the data type of this variant using a string.-
Methods inherited from interface net.ontopia.topicmaps.core.ReifiableIF
getReifier, setReifier
-
Methods inherited from interface net.ontopia.topicmaps.core.ScopedIF
addTheme, getScope, removeTheme
-
Methods inherited from interface net.ontopia.topicmaps.core.TMObjectIF
addItemIdentifier, getItemIdentifiers, getObjectId, getTopicMap, isReadOnly, remove, removeItemIdentifier
-
-
-
-
Field Detail
-
EVENT_ADDED
static final String EVENT_ADDED
- See Also:
- Constant Field Values
-
EVENT_REMOVED
static final String EVENT_REMOVED
- See Also:
- Constant Field Values
-
EVENT_SET_VALUE
static final String EVENT_SET_VALUE
- See Also:
- Constant Field Values
-
EVENT_SET_DATATYPE
static final String EVENT_SET_DATATYPE
- See Also:
- Constant Field Values
-
EVENT_ADD_THEME
static final String EVENT_ADD_THEME
- See Also:
- Constant Field Values
-
EVENT_REMOVE_THEME
static final String EVENT_REMOVE_THEME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTopicName
TopicNameIF getTopicName()
PUBLIC: Gets the topic name to which this variant name belongs. The topic name may be a direct parent or an ancestor.- Returns:
- The topic name of which this is a variant; an object implementing TopicNameIF.
-
getDataType
LocatorIF getDataType()
PUBLIC: Gets the data type of this variant.- Since:
- 4.0
-
getValue
String getValue()
PUBLIC: Gets the string representation of this variant. This method will return null if the length of the value exceeds the supported maximum size.
-
getReader
Reader getReader()
PUBLIC: Returns a Reader that allows you to stream the string representation of this variant. Values of all sizes are supported by this method.- Since:
- 4.0
-
setValue
default void setValue(String value)
PUBLIC: Same assetValue(value, DataTypes.TYPE_STRING)
. This method is here primarily for backwards compatibility.
-
getLocator
default LocatorIF getLocator()
PUBLIC: Returns a LocatorIF representation of the variant value. This method will return null if the value is not of type xsd:anyURI (same asDataType.TYPE_URI
). This method is here primarily for backwards compatibility.
-
setLocator
default void setLocator(LocatorIF locator)
PUBLIC: Same assetValue(locator.getAddress(), DataTypes.TYPE_URI)
. This method is here primarily for backwards compatibility.
-
setValue
void setValue(String value, LocatorIF datatype)
PUBLIC: Sets the value and the data type of this variant using a string. The value must conform to the correct string representation according to the datatype.- Since:
- 4.0
-
setReader
void setReader(Reader value, long length, LocatorIF datatype)
PUBLIC: Sets the value and the data type of this variant using a reader. The reader value must conform to the correct string representation according to the datatype.- Since:
- 4.0
-
getLength
long getLength()
PUBLIC: Returns the length of the variant value. The number of characters in the string representation is returned.- Since:
- 4.0
-
-