com.isomorphic.datasource
Class DSField

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.HashMap
              |
              +--com.isomorphic.datasource.DSField
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class DSField
extends java.util.HashMap

See Also:
Serialized Form

Method Summary
 java.lang.String getForeignKey()
          Returns the foreign key, if set.
 java.lang.Long getLength()
          Returns the length of this field, if specified.
 java.lang.String getName()
          Returns the name of this field.
 java.lang.String getProperty(java.lang.String property)
          For an XML DataSource, returns the value of the specified attribute as a string.
 java.lang.String getTitle()
          Returns the title of this field, if any.
 java.lang.String getType()
          Returns the type of this field.
 java.lang.String getValueXPath()
          For an XML DataSource, returns the XPath expression used to retrieve the field value.
 boolean isPrimaryKey()
          Returns true if this field is a primary key, false otherwise.
 boolean isRequired()
          Returns true if this field is required, false otherwise.
 

Method Detail

getName

public java.lang.String getName()
Returns the name of this field.
Returns:
the name of this field

isRequired

public boolean isRequired()
Returns true if this field is required, false otherwise.
Returns:
true if this field is required, false otherwise

getType

public java.lang.String getType()
Returns the type of this field.

Valid values include: text, boolean, integer, float, date, sequence, link, image, binary and imageFile.

Returns:
the type of this field

getLength

public java.lang.Long getLength()
Returns the length of this field, if specified.
Returns:
the length of this field, if specified

getTitle

public java.lang.String getTitle()
Returns the title of this field, if any.
Returns:
the title of this field, if any

isPrimaryKey

public boolean isPrimaryKey()
Returns true if this field is a primary key, false otherwise.
Returns:
true if this field is a primary key, false otherwise

getForeignKey

public java.lang.String getForeignKey()
Returns the foreign key, if set.

If set, declares that this field holds values that can be matched to values from another DataSource field, to create a relationship between records from different DataSources or even records within the same DataSource.

The format of the foreign key is <dataSourceId>.<fieldName>.

Returns:
the foreign key, if set

getValueXPath

public java.lang.String getValueXPath()
For an XML DataSource, returns the XPath expression used to retrieve the field value. This expression will be evaluated relative to the record element.
Returns:
the XPath expression

getProperty

public java.lang.String getProperty(java.lang.String property)
For an XML DataSource, returns the value of the specified attribute as a string.
Parameters:
property - the name of the attribute
Returns:
the value of the specified attribute as a string