public class VariableValue extends Object
Constructor and Description |
---|
VariableValue(Datatype datatype,
Object value)
Creates and validates a variable value.
|
Modifier and Type | Method and Description |
---|---|
Datatype |
getDatatype() |
Object |
getValue() |
protected void |
logInvalidXML(String s) |
String |
toString() |
public VariableValue(Datatype datatype, Object value) throws InvalidValueException
If the given value is a String
, it will be converted
with Datatype.valueOf(String)
. Any
other value will be checked, whether it matches the datatype and if its
string representation is valid in XML documents (unicode character test).
Note that for performance reasons, validation of a non-string value argument is skipped if executed on an Android runtime!
datatype
- The type of the variable.value
- The value of the variable.InvalidValueException
- If the value is invalid for the given datatype, or if
its string representation is invalid in XML.Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.