Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.instance.model.impl
Class InstanceDecorator

java.lang.Object
  extended by eu.esdihumboldt.hale.common.instance.model.impl.InstanceDecorator
All Implemented Interfaces:
Group, Instance
Direct Known Subclasses:
FamilyInstanceImpl

public class InstanceDecorator
extends Object
implements Instance

Instance decorator class.

Author:
Kai Schwierczek

Constructor Summary
InstanceDecorator(Instance instance)
          Constructs the decorator with the given instance.
 
Method Summary
 DataSet getDataSet()
          Get the data set the instance is associated to.
 TypeDefinition getDefinition()
          Get the definition of the type associated with the instance
 List<Object> getMetaData(String key)
          Get the metadata the instance my be associated with
 Set<String> getMetaDataNames()
          Get all keys the metadata is associated with
 Instance getOriginalInstance()
          Returns the original instance.
 Object[] getProperty(QName propertyName)
          Get the values for the property with the given name.
 Iterable<QName> getPropertyNames()
          Get the property names for which any values exist.
 Object getValue()
          Get the instance value.

The value is only present for certain types where the HasValueFlag or AugmentedValueFlag constraint is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstanceDecorator

public InstanceDecorator(Instance instance)
Constructs the decorator with the given instance.

Parameters:
instance - the instance to decorate
Method Detail

getOriginalInstance

public Instance getOriginalInstance()
Returns the original instance.

Returns:
the original instance

getProperty

public Object[] getProperty(QName propertyName)
Description copied from interface: Group
Get the values for the property with the given name. Values can also be groups or instances.

Specified by:
getProperty in interface Group
Parameters:
propertyName - the property name
Returns:
the property values, may be null if none exist
See Also:
Group.getProperty(javax.xml.namespace.QName)

getPropertyNames

public Iterable<QName> getPropertyNames()
Description copied from interface: Group
Get the property names for which any values exist. Especially helpful when there is (for whatever reason) no type definition associated to the instance.

Specified by:
getPropertyNames in interface Group
Returns:
the list of property names with associated values
See Also:
Group.getPropertyNames()

getDefinition

public TypeDefinition getDefinition()
Description copied from interface: Instance
Get the definition of the type associated with the instance

Specified by:
getDefinition in interface Group
Specified by:
getDefinition in interface Instance
Returns:
the instance's type definition
See Also:
Instance.getDefinition()

getValue

public Object getValue()
Description copied from interface: Instance
Get the instance value.

The value is only present for certain types where the HasValueFlag or AugmentedValueFlag constraint is enabled. The Binding constraint on the type definition defines the binding of the value.

NOTE: This is needed for instance for XML elements with text content and attributes. It may only be a simple value (i.e. no Group or Instance).

Specified by:
getValue in interface Instance
Returns:
the instance value if it is defined, otherwise null
See Also:
Instance.getValue()

getDataSet

public DataSet getDataSet()
Description copied from interface: Instance
Get the data set the instance is associated to.

Specified by:
getDataSet in interface Instance
Returns:
the instance data set, null if not set
See Also:
Instance.getDataSet()

getMetaData

public List<Object> getMetaData(String key)
Description copied from interface: Instance
Get the metadata the instance my be associated with

Specified by:
getMetaData in interface Instance
Parameters:
key - the key to access a certain metadata
Returns:
A list of objects from the metadata, may be an empty List if the key can not be found or there is not metadata associated with the Instance
See Also:
Instance.getMetaData(java.lang.String)

getMetaDataNames

public Set<String> getMetaDataNames()
Description copied from interface: Instance
Get all keys the metadata is associated with

Specified by:
getMetaDataNames in interface Instance
Returns:
an Set of String keys, or an empty Set if the data doesn't exist or the container is empty, the Set may not be changed
See Also:
Instance.getMetaDataNames()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d