it.biobytes.ammentos
Interface FieldType

All Known Implementing Classes:
BooleanType, DateTimeType, DoubleType, EntityType, IntegerType, LongType, StringType

public interface FieldType

Describes a valid type of data for a Field

Author:
davide

Method Summary
 java.lang.Object addValues(java.lang.Object value1, java.lang.Object value2)
          Returns the sum of the provided values, or null if summing is not possible
 java.lang.String formatValue(java.lang.Object value)
           
 java.lang.Object generateValue()
           
 java.lang.Class getMappedClass()
          Gets the underlying mappes Java class represented from elements of this type
 java.lang.Object[] getPossibleValues()
           
 boolean isNumeric()
           
 java.lang.Object loadValue(java.sql.ResultSet rs, Field field)
           
 java.lang.Object parseValue(java.lang.String str)
           
 void setParamValue(java.lang.Object fieldValue, java.sql.PreparedStatement pstmt, int paramIndex)
           
 

Method Detail

setParamValue

void setParamValue(java.lang.Object fieldValue,
                   java.sql.PreparedStatement pstmt,
                   int paramIndex)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

loadValue

java.lang.Object loadValue(java.sql.ResultSet rs,
                           Field field)
                           throws java.sql.SQLException
Throws:
java.sql.SQLException

parseValue

java.lang.Object parseValue(java.lang.String str)
                            throws PersistenceException
Throws:
PersistenceException

formatValue

java.lang.String formatValue(java.lang.Object value)

generateValue

java.lang.Object generateValue()
                               throws PersistenceException
Throws:
PersistenceException

isNumeric

boolean isNumeric()

getPossibleValues

java.lang.Object[] getPossibleValues()

getMappedClass

java.lang.Class getMappedClass()
Gets the underlying mappes Java class represented from elements of this type

Returns:
the Java class mapped from this FieldType

addValues

java.lang.Object addValues(java.lang.Object value1,
                           java.lang.Object value2)
Returns the sum of the provided values, or null if summing is not possible

Parameters:
value1 - First value to add
value2 - Second value to add