public interface PoemType<T>
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.
| Modifier and Type | Method and Description |
|---|---|
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.
|
<O> PoemType<O> |
canRepresent(PoemType<O> 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.
|
void assertValidRaw(Object raw) throws TypeMismatchPoemException, ValidationPoemException
raw - the raw value to checkTypeMismatchPoemException - if the raw is of the wrong typeValidationPoemException - if the raw has an illegal valueEnumeration<T> possibleRaws()
String stringOfRaw(Object object) throws TypeMismatchPoemException, ValidationPoemException
object - the valueTypeMismatchPoemException - if the raw is of the wrong typeValidationPoemException - if the raw has an illegal valueT rawOfString(String rawString) throws ParsingPoemException, ValidationPoemException
rawString - the String representation to convertParsingPoemException - if the String representation is not well formedValidationPoemException - if the raw has an illegal valuevoid assertValidCooked(Object cooked) throws TypeMismatchPoemException, ValidationPoemException
cooked - the Object to checkTypeMismatchPoemException - if the raw is of the wrong typeValidationPoemException - if the raw has an illegal valueObject cookedOfRaw(Object raw) throws TypeMismatchPoemException, PoemException
raw - the object, typically a troidTypeMismatchPoemException - if the raw is of the wrong typePoemException - if there is another problem, such as no object with that troidT rawOfCooked(Object cooked) throws TypeMismatchPoemException
cooked - the Persistent or ObjectTypeMismatchPoemException - if the raw is of the wrong typeString stringOfCooked(Object cooked, PoemLocale locale, int style) throws TypeMismatchPoemException, PoemException
cooked - the PoemType to be stringifiedlocale - to be used for datesstyle - as in java.text.DateFormat.SHORT, ...TypeMismatchPoemException - if the raw is of the wrong typePoemException - if there is an access violationboolean getNullable()
<O> PoemType<O> canRepresent(PoemType<O> other)
O - the type of the PoemTypeother - the other type to checkPoemType<T> withNullable(boolean nullable)
nullable - the nullability we wantvoid saveColumnInfo(ColumnInfo columnInfo) throws AccessPoemException
columnInfo - the ColumnInfo to set the type ofAccessPoemException - if our AccessToken does not permit modificationString toDsdType()
Copyright © 2000–2021 PanEris. All rights reserved.