@Immutable public class ParameterValue extends Value
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TYPE
The name of the default type of value.
|
static ParameterValue |
NULL
The
null parameter value. |
Constructor and Description |
---|
ParameterValue(String value)
Create a simple string value.
|
ParameterValue(String type,
Value value)
Constructor specifying the type and the value.
|
ParameterValue(Value value)
Constructor specifying the value only.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
as(Class<T> expectedType)
Get the value as the expected type if possible.
|
<T> T |
as(Class<T> expectedType,
T defValue)
Get the value as the expected type if possible, a default value
otherwise.
|
Element |
getDOMRepresentation()
Get the value's DOM representation if applicable.
|
String |
getStringRepresentation()
Get the value's string representation.
|
String |
getType()
Returns the type of the value.
|
Object |
getValue()
Returns the value.
|
Value |
intern()
Get the internal value.
|
boolean |
isEmpty()
Determines if the value is empty.
|
boolean |
isRepresentedAsDOM()
Determines if the value is represented as DOM
Element for
serializing it. |
boolean |
needsProcessing()
Determines if the parameter needs further processing to be used, i.e.
|
public static final ParameterValue NULL
null
parameter value.public static final String DEFAULT_TYPE
null
represents also
the default type.public ParameterValue(String type, Value value)
type
- the type of the valuevalue
- the valuepublic ParameterValue(Value value)
value
- the valuepublic ParameterValue(String value)
value
- the valuepublic boolean needsProcessing()
DEFAULT_TYPE
nor null
.public String getType()
null
or a script id.public Object getValue()
public <T> T as(Class<T> expectedType)
Value
as
in class Value
expectedType
- the expected value type, this must be either
String
, DOM Element
or a complex value type
defined in the ComplexValueExtension
null
if it could
not be created/convertedpublic <T> T as(Class<T> expectedType, T defValue)
Value
as
in class Value
expectedType
- the expected value type, this must be either
String
, DOM Element
or a complex value type
defined in the ComplexValueExtension
defValue
- the default value to use if the value is
null
or cannot be converted to the expected typepublic boolean isEmpty()
Value
public boolean isRepresentedAsDOM()
Value
Element
for
serializing it.isRepresentedAsDOM
in class Value
Element
Value.getDOMRepresentation()
,
Value.getStringRepresentation()
public Element getDOMRepresentation()
Value
getDOMRepresentation
in class Value
Element
representing the value or null
if
Value.isRepresentedAsDOM()
yields false
Value.isRepresentedAsDOM()
public String getStringRepresentation()
Value
getStringRepresentation
in class Value
null
if
Value.isRepresentedAsDOM()
yields true
Value.isRepresentedAsDOM()
public Value intern()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a