|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PoemType<T>
A data type.
PoemTypes come in two flavours: the predefined ones and those that can be defined by the application programmer; the former have a negative type code, the latter a positive one.
Method Summary | |
---|---|
void |
assertValidCooked(Object cooked)
Check if an Object is valid, throw appropriate Exception if not. |
void |
assertValidRaw(Object raw)
Check if value is of the right type and an allowed value, throw appropriate Exception if not. |
PoemType<?> |
canRepresent(PoemType<?> other)
Return a PoemType which can can represent another, or null. |
Object |
cookedOfRaw(Object raw)
Create an Object from a raw Object, a no-op for all but ReferencePoemTypes. |
boolean |
getNullable()
Whether the type is nullable. |
Enumeration<T> |
possibleRaws()
Get the possible values for this field, null for rangeable types with no range set. |
T |
rawOfCooked(Object cooked)
Return the Object value, a no-op for all but ReferencePoemTypes, for which it returns the troid as an Integer. |
T |
rawOfString(String rawString)
Get an Object from its String representation. |
void |
saveColumnInfo(ColumnInfo columnInfo)
Set the type of the ColumnInfo. |
String |
stringOfCooked(Object cooked,
PoemLocale locale,
int style)
A localised String representation of the oject. |
String |
stringOfRaw(Object object)
The String representation of the Field. |
String |
toDsdType()
The field type used in the Data Structure Definition language. |
PoemType<T> |
withNullable(boolean nullable)
Get a new type with a nullablity, presumably different. |
Method Detail |
---|
void assertValidRaw(Object raw) throws TypeMismatchPoemException, ValidationPoemException
raw
- the raw value to check
TypeMismatchPoemException
- if the raw is of the wrong type
ValidationPoemException
- if the raw has an illegal valueEnumeration<T> possibleRaws()
String stringOfRaw(Object object) throws TypeMismatchPoemException, ValidationPoemException
object
- the value
TypeMismatchPoemException
- if the raw is of the wrong type
ValidationPoemException
- if the raw has an illegal valueT rawOfString(String rawString) throws ParsingPoemException, ValidationPoemException
rawString
- the String representation to convert
ParsingPoemException
- if the String representation is not well formed
ValidationPoemException
- if the raw has an illegal valuevoid assertValidCooked(Object cooked) throws TypeMismatchPoemException, ValidationPoemException
cooked
- the Object to check
TypeMismatchPoemException
- if the raw is of the wrong type
ValidationPoemException
- if the raw has an illegal valueObject cookedOfRaw(Object raw) throws TypeMismatchPoemException, PoemException
raw
- the object, typically a troid
TypeMismatchPoemException
- if the raw is of the wrong type
PoemException
- if there is another problem, such as no object with that troidT rawOfCooked(Object cooked) throws TypeMismatchPoemException
cooked
- the Persistent or Object
TypeMismatchPoemException
- if the raw is of the wrong typeString stringOfCooked(Object cooked, PoemLocale locale, int style) throws TypeMismatchPoemException, PoemException
style
- as in java.text.DateFormat.SHORT, ...
TypeMismatchPoemException
- if the raw is of the wrong type
PoemException
- if there is an access violationboolean getNullable()
PoemType<?> canRepresent(PoemType<?> other)
other
- the other type to check
PoemType<T> withNullable(boolean nullable)
nullable
- the nullability we want
void saveColumnInfo(ColumnInfo columnInfo) throws AccessPoemException
columnInfo
- the ColumnInfo to set the type of
AccessPoemException
- if our AccessToken does not permit modificationString toDsdType()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |