com.silverpeas.form.record
Class GenericDataRecord

java.lang.Object
  extended by com.silverpeas.form.record.GenericDataRecord
All Implemented Interfaces:
DataRecord, Serializable

public class GenericDataRecord
extends Object
implements DataRecord, Serializable

A GenericDataRecord use a Field[] and a GenericRecordTemplate.

See Also:
Serialized Form

Constructor Summary
GenericDataRecord(RecordTemplate template)
          A GenericDataRecord is built from a RecordTemplate.
 
Method Summary
 Field getField(int fieldIndex)
          Returns the field at the index position in the record.
 Field getField(String fieldName)
          Returns the named field.
 Field getField(String fieldName, int occurrence)
           
 String[] getFieldNames()
           
 Field[] getFields()
          Returns all the fields
 String getId()
          Returns the data record id.
 String getLanguage()
           
 Map<String,String> getValues(String language)
           
 boolean isNew()
          Return true if this record has not been inserted in a RecordSet.
 void setId(String id)
          Gives an id to the record.
 void setLanguage(String language)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericDataRecord

public GenericDataRecord(RecordTemplate template)
                  throws FormException
A GenericDataRecord is built from a RecordTemplate.

Throws:
FormException
Method Detail

getId

public String getId()
Returns the data record id. The record is known by its external id.

Specified by:
getId in interface DataRecord

setId

public void setId(String id)
Gives an id to the record. Caution ! the record is known by its external id.

Specified by:
setId in interface DataRecord

getFields

public Field[] getFields()
Returns all the fields


getField

public Field getField(String fieldName)
               throws FormException
Returns the named field.

Specified by:
getField in interface DataRecord
Throws:
FormException

getField

public Field getField(String fieldName,
                      int occurrence)
Specified by:
getField in interface DataRecord

getField

public Field getField(int fieldIndex)
               throws FormException
Returns the field at the index position in the record.

Specified by:
getField in interface DataRecord
Throws:
FormException

isNew

public boolean isNew()
Return true if this record has not been inserted in a RecordSet.

Specified by:
isNew in interface DataRecord

getFieldNames

public String[] getFieldNames()
Specified by:
getFieldNames in interface DataRecord

getLanguage

public String getLanguage()
Specified by:
getLanguage in interface DataRecord

setLanguage

public void setLanguage(String language)
Specified by:
setLanguage in interface DataRecord

getValues

public Map<String,String> getValues(String language)
Specified by:
getValues in interface DataRecord


Copyright © 2016 Silverpeas. All Rights Reserved.