T - the underlying data type of the valuespublic class ValueTypeImpl<T> extends DBObjectImpl implements ValueType<T>
ValueType.
In agreement with the convention mentioned in the ValueScanner
class comment, the value type is passed to value scanner constructors
when such constructors are available.| Modifier and Type | Class and Description |
|---|---|
static class |
ValueTypeImpl.BooleanScanner
A value scanner for boolean data.
|
static class |
ValueTypeImpl.DateScanner
A value scanner for data representing
Days. |
static class |
ValueTypeImpl.DateTimeScanner
A value scanner for data representing
DateTimes. |
static class |
ValueTypeImpl.NameScanner
A value scanner for textual data representing simple names.
|
static class |
ValueTypeImpl.NumberScanner
A value scanner for numeric data.
|
static class |
ValueTypeImpl.TextScanner
A value scanner for textual data.
|
static class |
ValueTypeImpl.TimeDomainScanner
A value scanner for data representing
TimeDomains. |
static class |
ValueTypeImpl.TypeScanner
A value scanner for data representing
ValueTypes. |
ValueType.StandardValueType| Modifier | Constructor and Description |
|---|---|
|
ValueTypeImpl(String name,
boolean restricted,
String scannerClassOrKeyword,
Map<String,String> valuesAndDescriptions,
Surrogate surrogate)
Construct a
ValueType. |
protected |
ValueTypeImpl(ValueTypeImpl<T> valueType)
This constructor is intended for
UpdatableValueTypeImpl when implementing
the edit() method. |
| Modifier and Type | Method and Description |
|---|---|
void |
check(T value)
Check that the value is allowed.
|
UpdatableValueType<T> |
edit()
Return an
UpdatableValueType corresponding to this value type. |
<S> ValueAccessMethods<T> |
getAccessMethods()
Return the value access methods object for this type.
|
String |
getExternalRepresentation()
Return a string providing an external representation of the value type.
|
String |
getName()
Return the name of the value type.
|
ValueScanner<T> |
getScanner()
Return the value scanner.
|
ValueType.StandardValueType |
getStandardValueType()
Return the constant representing the value type when it is a built-in value type.
|
Class<T> |
getType()
Return the class of the underlying data type.
|
Map<T,String> |
getValueDescriptions()
Return a map with allowed values as keys and a description for each
value.
|
Set<T> |
getValues()
Return the set of allowed values.
|
Collection<String> |
getValues(String format)
Return values and descriptions as a collection of formatted strings.
|
boolean |
isBuiltIn()
Deprecated.
|
boolean |
isCompatible(Object obj)
Returns true if the object can be assigned to a variable of the
underlying data type.
|
boolean |
isRestricted()
Return true if the value type maintains an exhaustive list of allowed values.
|
T |
scan(String value)
Convert the argument to an object of the underlying data type.
|
String |
toString() |
String |
toString(Object value)
Convert the argument to a string.
|
<S> ValueType<S> |
typeCheck(Class<S> type)
Cast the value type to the type specified.
|
protected void |
update()
Refresh state.
|
equals, getDatabase, getId, getSurrogate, hashCode, inConstruction, isValidclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetDatabase, getId, getSurrogate, inConstruction, isValidprotected ValueTypeImpl(ValueTypeImpl<T> valueType) throws T2DBException
UpdatableValueTypeImpl when implementing
the edit() method.valueType - T2DBExceptionpublic ValueTypeImpl(String name, boolean restricted, String scannerClassOrKeyword, Map<String,String> valuesAndDescriptions, Surrogate surrogate) throws T2DBException
ValueType.name - a stringrestricted - if true the value type will keep a list of allowed valuesscannerClassOrKeyword - a keyword identifying a standard value type of the name of a scanner classvaluesAndDescriptions - a map of allowed values (as strings) and their descriptionsurrogate - a surrogateT2DBExceptionprotected void update()
throws T2DBException
T2DBExceptionpublic UpdatableValueType<T> edit()
ValueTypeUpdatableValueType corresponding to this value type.
Successfully getting an Updatable object does not imply
that updates can be successfully applied.public <S> ValueAccessMethods<T> getAccessMethods() throws T2DBException
T2DBExceptionpublic String getName()
ValueTypepublic boolean isRestricted()
ValueTypeisRestricted in interface ValueType<T>@Deprecated public boolean isBuiltIn()
ValueTypepublic Class<T> getType()
ValueTypepublic ValueScanner<T> getScanner()
ValueTypegetScanner in interface ValueType<T>public Set<T> getValues()
ValueTypepublic Map<T,String> getValueDescriptions()
ValueTypegetValueDescriptions in interface ValueType<T>public boolean isCompatible(Object obj)
ValueTypeValueType.check(T) for that.isCompatible in interface ValueType<T>obj - an objectpublic T scan(String value) throws T2DBException
ValueTypescan in interface ValueType<T>value - a stringT2DBExceptionpublic void check(T value) throws T2DBException
ValueTypecheck in interface ValueType<T>value - a valueT2DBExceptionpublic String toString(Object value) throws T2DBException
ValueTypetoString in interface ValueType<T>value - a valueT2DBExceptionpublic Collection<String> getValues(String format)
ValueTypepublic String getExternalRepresentation()
ValueTypegetExternalRepresentation in interface ValueType<T>public ValueType.StandardValueType getStandardValueType()
ValueTypegetStandardValueType in interface ValueType<T>public <S> ValueType<S> typeCheck(Class<S> type) throws T2DBException
ValueTypetypeCheck in interface ValueType<T>type - the underlying type requiredT2DBExceptionCopyright © 2017. All rights reserved.