|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.starlink.plastic.ValueType
Defines the type of a value which is passed through the PLASTIC messaging system. These types define what is legal for the arguments and return values of each particular message. The types defined are ones which can be transmitted and have the same meaning using both the Java RMI and the XML-RPC transport modes.
MessageDefinition
Field Summary | |
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/ |
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 Summary | |
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. |
Method Summary | |
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()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
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
Constructor Detail |
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()
)Method Detail |
public void checkJavaValue(Object jValue) throws ValueTypeException
ValueTypeException
will be
thrown.
jValue
- value to check
ValueTypeException
public Object getBlankValue()
public String toString()
public static ValueType inferValueType(Object value) throws ValueTypeException
value
- example value
value
might be an instance of
ValueTypeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |