public class ValueType extends Object
MessageDefinition
Modifier and Type | Field and Description |
---|---|
static ValueType |
ANY
No constraints - any object is permissible.
|
static ValueType |
BOOLEAN
Boolean type.
|
static ValueType |
DATE
ISO-8601 date type.
|
static ValueType |
DOUBLE
Double precision type.
|
static ValueType |
INT
Integer type.
|
static ValueType |
LIST
List/<array> type.
|
static ValueType |
LIST_INTS
List/<array> type in which all elements must be integers.
|
static ValueType |
MAP
Map/<struct> type.
|
static ValueType |
STRING
String type.
|
static ValueType |
STRING_IVORN
Type for a string which is required to be a legal IVORN.
|
static ValueType |
STRING_URI
Type for a string which is required to be a legal URI.
|
static ValueType |
STRING_URL
Type for a string which is required to be a legal URL.
|
static ValueType |
VOID
Void type - the return type for methods with no return value.
|
Constructor and Description |
---|
ValueType(String name,
Class jClazz,
Object blank)
Constructs a basic value type with a given symbolic name and a
java class which all legal values of this type must instantiate.
|
Modifier and Type | Method and Description |
---|---|
void |
checkJavaValue(Object jValue)
Checks a value sent or received using Java-RMI.
|
Object |
getBlankValue()
Returns a neutral sort of value which is legal for this type.
|
static ValueType |
inferValueType(Object value)
Guesses from a single value what type it might correspond to.
|
String |
toString() |
public static ValueType ANY
public static ValueType INT
public static ValueType BOOLEAN
public static ValueType STRING
public static ValueType DOUBLE
public static ValueType DATE
public static ValueType MAP
public static ValueType LIST
public static ValueType VOID
public static ValueType STRING_URL
public static ValueType STRING_IVORN
public static ValueType STRING_URI
public static ValueType LIST_INTS
public ValueType(String name, Class jClazz, Object blank)
name
- label for this type (for documentation purposes only)jClazz
- required assignable java classblank
- suitable blank value (see getBlankValue()
)public void checkJavaValue(Object jValue) throws ValueTypeException
ValueTypeException
will be
thrown.jValue
- value to checkValueTypeException
public Object getBlankValue()
public static ValueType inferValueType(Object value) throws ValueTypeException
value
- example valuevalue
might be an instance ofValueTypeException
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.