public class ValueSerializer extends Object
Using this class instances can be written in xml attributes as strings.
Constructor and Description |
---|
ValueSerializer() |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvertFromString(String value,
IValueSerializerContext context)
Determines whether this instance can convert the specified value from the given string.
|
boolean |
canConvertToString(Object value,
IValueSerializerContext context)
Determines whether this instance can convert the specified value to a string.
|
Object |
convertFromString(String value,
IValueSerializerContext context)
Converts the string to an appropriate instance.
|
String |
convertToString(Object o,
IValueSerializerContext context)
Converts the given value to string.
|
static ValueSerializer |
getSerializerFor(PropertyInfo propertyInfo)
Gets the
ValueSerializer implementation for the given descriptor. |
static ValueSerializer |
getSerializerFor(PropertyInfo propertyInfo,
IValueSerializerContext context)
Gets the
ValueSerializer implementation for the given descriptor. |
static ValueSerializer |
getSerializerFor(Type type)
Gets the
ValueSerializer implementation for the given type. |
static ValueSerializer |
getSerializerFor(Type type,
IValueSerializerContext context)
Gets the
ValueSerializer implementation for the given type. |
public boolean canConvertFromString(String value, IValueSerializerContext context)
value
- The string value to convert.context
- The context.true
if this instance can convert the specified value from the string; otherwise, false
.public boolean canConvertToString(Object value, IValueSerializerContext context)
value
- The value.context
- The context.true
if this instance can convert the specified value to a string; otherwise, false
.public Object convertFromString(String value, IValueSerializerContext context)
value
- The value to convert to an object.context
- The context.public String convertToString(Object o, IValueSerializerContext context)
o
- The value.context
- The context.public static final ValueSerializer getSerializerFor(PropertyInfo propertyInfo)
ValueSerializer
implementation for the given descriptor.propertyInfo
- The descriptor.public static final ValueSerializer getSerializerFor(PropertyInfo propertyInfo, IValueSerializerContext context)
ValueSerializer
implementation for the given descriptor.propertyInfo
- The descriptor.context
- The context.public static final ValueSerializer getSerializerFor(Type type)
ValueSerializer
implementation for the given type.type
- The type.public static final ValueSerializer getSerializerFor(Type type, IValueSerializerContext context)
ValueSerializer
implementation for the given type.type
- The type.context
- The context.