at.spardat.xma.datasource
Class Domain

java.lang.Object
  extended byat.spardat.xma.datasource.Domain

public class Domain
extends java.lang.Object

A utility class to access a XMA-domain-table (see ITabularDomData). This class can be used to get long or short values of domain keys or to retrieved the complete domain. Usually this is not needed, as the domain handling is done by widget models. All domain values can be retrieved by this class or one domain row identfied by its key. Domain rows are returned as IDomRow objects. This class itself does not store any domain specific values beside the specTable given by getInstance() identifying a domain.

At construction time, the domain-table is specified by providing a specification String, see ITabularDataSource.

This class may only be used at the server side of XMA.


Method Summary
 java.lang.String getDomainType()
          Extracts the value of the type-parameter from the baseSpec.
 IDomRow getDomRow(java.lang.String key)
          Returns an object providing information about a domain value whose key is given.
 IDomRow[] getDomRows()
          Returns an array with all time valid IDomRows of a domain.
 IDomRow[] getDomRows(boolean onlyInValidTimeRange)
          Returns an array with all IDomRows of a domain.
 ITabularDomData getDomTable()
          Returns the table of domain values associated with the current environment.
static Domain getInstance(java.lang.String specTable)
          Returns an Domain object associated with a domain identified by specTable
 java.lang.String getLongValue(java.lang.String key)
          Returns the Locale-dependent long value associated with the key stored in this.
 java.lang.String getShortValue(java.lang.String key)
          Returns the Locale-dependent short value associated with the key.
 java.lang.String getSpecTable()
          Returns the String that specifies the domain table.
 boolean isInTable(java.lang.String key)
          Returns whether there exists a row in the associated domain table whose key is the one stored in this.
 boolean isValid(java.lang.String key)
          Returns whether the key identifies a row in the associated domain table and the row is valid with respect to the valid-begin- and end-dates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Domain getInstance(java.lang.String specTable)
Returns an Domain object associated with a domain identified by specTable

Parameters:
specTable - Example: "type=rsc,bundle=at.spardat.xma.samplespar.data.kestpflicht"
Returns:
Since:
version_number

getSpecTable

public java.lang.String getSpecTable()
Returns the String that specifies the domain table.


getDomTable

public ITabularDomData getDomTable()
Returns the table of domain values associated with the current environment. Note that the returned table is dependent on the current session, particularely on the values in the XMAContext.

Note that this method may only be used if the executing thread is the same that dispatched the XMA-RemoteCall.

Returns:
an Object encapsulating the list of domain values of the domain table specified at construction time.

getDomRow

public IDomRow getDomRow(java.lang.String key)
Returns an object providing information about a domain value whose key is given. The domain table is looked up for the key and the right IDomRow object for the key is returned.

Note that this method may only be used if the executing thread is the same that dispatched the XMA-RemoteCall.

Returns:
IDomRow object or null, if !hasValue() or the table does not contain a record with the stored key.

getShortValue

public java.lang.String getShortValue(java.lang.String key)
Returns the Locale-dependent short value associated with the key.

Returns:
short value or the empty String if the key is not in the domain table.

getLongValue

public java.lang.String getLongValue(java.lang.String key)
Returns the Locale-dependent long value associated with the key stored in this.

Returns:
long value or the empty String if the key is not in the domain table.

isValid

public boolean isValid(java.lang.String key)
Returns whether the key identifies a row in the associated domain table and the row is valid with respect to the valid-begin- and end-dates. Hence, this method defines if the value is a end-user visible one or not. Programmers should use isInTable() to figure out if a value is contained in the table.

Returns:
boolean indicating that the value is in the validity-time-range.
See Also:
ITabularDomData

isInTable

public boolean isInTable(java.lang.String key)
Returns whether there exists a row in the associated domain table whose key is the one stored in this.

Returns:
true, if the key is present in the dom table. true implies that getDomRow() != null and vice versa.

getDomainType

public java.lang.String getDomainType()
Extracts the value of the type-parameter from the baseSpec.


getDomRows

public IDomRow[] getDomRows(boolean onlyInValidTimeRange)
Returns an array with all IDomRows of a domain. A IDomRow provides information about a domain row. Note that this method may only be used if the executing thread is the same that dispatched the XMA-RemoteCall.

Parameters:
onlyInValidTimeRange - if true then only rows with IDomRow.isInValidTimeRange() are returned - if false all rows are returned.
Returns:
An array with IDomRows of a domain.
Since:
version_number

getDomRows

public IDomRow[] getDomRows()
Returns an array with all time valid IDomRows of a domain. A IDomRow provides information about a domain row. Note that this method may only be used if the executing thread is the same that dispatched the XMA-RemoteCall.

Returns:
An array with all time valid IDomRows of a domain..
Since:
version_number