ewe.database
Class FieldModifier

java.lang.Object
  extended byewe.database.FieldModifier
All Implemented Interfaces:
DatabaseTypes, DataValidator, Encodable

public class FieldModifier
extends Object
implements Encodable, DatabaseTypes, DataValidator

Do not use this class directly - it is used and stored internally by the Database.


Field Summary
 int fieldID
           
 int fieldType
           
 String modifiedData
           
 int modifier
           
 
Fields inherited from interface ewe.database.DatabaseTypes
BOOLEAN, BYTE_ARRAY, CREATED_FIELD, DATE, DATE_TIME, DECIMAL, DOUBLE, FIRST_SPECIAL_FIELD, FLAG_SYNCHRONIZED, FLAGS_FIELD, INTEGER, JAVA_OBJECT, LONG, MAX_ID, MODIFIED_BY_FIELD, MODIFIED_FIELD, NAME_FIELD, OBJECT_BYTES_FIELD, OBJECT_TEXT_FIELD, OID_FIELD, reservedFieldHeaders, reservedFieldIDs, reservedFieldNames, reservedFieldTypes, SORT_DATE_ONLY, SORT_IGNORE_CASE, SORT_TIME_ONLY, SORT_UNKNOWN_IS_GREATER_THAN_KNOWN, SORT_UNKNOWN_IS_LESS_THAN_KNOWN, STRING, TIME, TIMESTAMP
 
Constructor Summary
FieldModifier()
           
 
Method Summary
 boolean decodeAfterReading(Database db)
           
protected  int getNextInteger()
           
 void modify(DatabaseEntry newData, DatabaseEntry oldData)
           
 void set(Database db, int fieldID, int modifier, Object data)
           
 void validateEntry(Database db, DatabaseEntry newData, DatabaseEntry oldData)
          This method can be used to either alter data before it is saved into the database or to abort a particular operation by throwing an InvalidDataException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

fieldID

public int fieldID

fieldType

public int fieldType

modifier

public int modifier

modifiedData

public String modifiedData
Constructor Detail

FieldModifier

public FieldModifier()
Method Detail

decodeAfterReading

public boolean decodeAfterReading(Database db)
                           throws IOException
Throws:
IOException

getNextInteger

protected int getNextInteger()
                      throws IOException
Throws:
IOException

modify

public void modify(DatabaseEntry newData,
                   DatabaseEntry oldData)
            throws IOException
Throws:
IOException

validateEntry

public void validateEntry(Database db,
                          DatabaseEntry newData,
                          DatabaseEntry oldData)
                   throws IOException
Description copied from interface: DataValidator
This method can be used to either alter data before it is saved into the database or to abort a particular operation by throwing an InvalidDataException.

This method is called under four circumstances.

  • When a new DatabaseEntry is being saved - in which case the newData parameter holds the new data while the oldData parameter will be null.
  • When a DatabaseEntry is being modified - in which case the newData parameter holds the new data while the oldData parameter will hold the old data.
  • When a DatabaseEntry is being deleted - in which case the newData parameter will be null while the oldData parameter will hold the old data.
  • When a DatabaseEntry is being read - in which case the newData parameter refers to the same object as the oldData parameter (i.e. newData == oldData).

    Specified by:
    validateEntry in interface DataValidator
    Parameters:
    db - The Database that holds the data.
    newData - The data being saved or changed or read. If you need to modify the data, then modify this parameter.
    oldData - The original data before the change or deletion.
    Throws:
    IOException

  • set

    public void set(Database db,
                    int fieldID,
                    int modifier,
                    Object data)