org.outerj.daisy.repository
Interface Field


public interface Field

Fields belong to documents (or versions of documents), and can be used for various purposes.

Often, fields will be used for meta-data about the document, though you can use them for whatever data that you want to have addressable on a finer level then that contained in the Parts.

A field is always based upon a FieldType, which defines the kind of data that the field can contain.

Note that a field has no setters methods, modifications can only be done through the containing Document. This is because fields can also be obtained from Versions, which are not modifiable.


Method Summary
 long getTypeId()
          The id of the field type of this field.
 java.lang.String getTypeName()
          The name of the field type (for convenience, this is retrieved from the RepositorySchema).
 java.lang.Object getValue()
          The value of the field.
 ValueType getValueType()
          The ValueType of the field, which defines the kind of object you will get from getValue().
 org.outerx.daisy.x10.FieldDocument getXml()
          Get an XML document describing this field.
 boolean isMultiValue()
          Indicates if this field is a multivalue field.
 

Method Detail

getTypeId

public long getTypeId()
The id of the field type of this field. More information on the field type can then be retrieved from the RepositorySchema.


getTypeName

public java.lang.String getTypeName()
The name of the field type (for convenience, this is retrieved from the RepositorySchema).


getValueType

public ValueType getValueType()
The ValueType of the field, which defines the kind of object you will get from getValue(). This method is here for convenience, the information is retrieved from the RepositorySchema.


isMultiValue

public boolean isMultiValue()
Indicates if this field is a multivalue field. This method is here for convenience, the information is retrieved from the RepositorySchema.


getValue

public java.lang.Object getValue()
The value of the field. This will never be null (otherwise the document wouldn't have the field in the first place). The kind of object returned is dependent of the ValueType, and of whether it concerns a multi-value field type. For multi-value fields, an array (Object[]) is returned.


getXml

public org.outerx.daisy.x10.FieldDocument getXml()
Get an XML document describing this field.



Copyright © -2005 . All Rights Reserved.