public class RangeConverter extends java.lang.Object implements ObjectConverter
| Modifier and Type | Field and Description |
|---|---|
static ConverterContext |
CONTEXT_MULTIPLE |
static ConverterContext |
CONTEXT_RANGE |
| Constructor and Description |
|---|
RangeConverter(java.lang.Class<?> elementClass)
Creates an ArrayConverter.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object[] |
arrayFromString(java.lang.String string,
ConverterContext context)
Converts from string to an array of objects, using separator to separate the string.
|
java.lang.String |
arrayToString(java.lang.Object[] objects,
ConverterContext context)
Converts from array to string by concating them with separators.
|
protected java.lang.Object |
fromString(int i,
java.lang.String s,
ConverterContext context) |
java.lang.Object |
fromString(java.lang.String string,
ConverterContext context)
Converts from String to an object.
|
boolean |
supportFromString(java.lang.String string,
ConverterContext context)
If it supports fromString.
|
boolean |
supportToString(java.lang.Object object,
ConverterContext context)
If it supports toString method.
|
protected java.lang.String |
toString(int i,
java.lang.Object o,
ConverterContext context) |
java.lang.String |
toString(java.lang.Object object,
ConverterContext context)
Converts from object to String based on current locale.
|
public static final ConverterContext CONTEXT_RANGE
public static final ConverterContext CONTEXT_MULTIPLE
public RangeConverter(java.lang.Class<?> elementClass)
elementClass - class of the array element. Assume all elements have the same class type. If not, use the
constructor which takes Class>[] as parameter.public java.lang.String arrayToString(java.lang.Object[] objects,
ConverterContext context)
objects - an array of objectscontext - converter contextprotected java.lang.String toString(int i,
java.lang.Object o,
ConverterContext context)
public java.lang.Object[] arrayFromString(java.lang.String string,
ConverterContext context)
string - string to be convertedcontext - converter contextprotected java.lang.Object fromString(int i,
java.lang.String s,
ConverterContext context)
public java.lang.String toString(java.lang.Object object,
ConverterContext context)
ObjectConvertertoString in interface ObjectConverterobject - object to be convertedcontext - converter context to be usedpublic boolean supportToString(java.lang.Object object,
ConverterContext context)
ObjectConvertersupportToString in interface ObjectConverterobject - object to be convertedcontext - converter context to be usedpublic java.lang.Object fromString(java.lang.String string,
ConverterContext context)
ObjectConverterfromString in interface ObjectConverterstring - the stringcontext - context to be convertedpublic boolean supportFromString(java.lang.String string,
ConverterContext context)
ObjectConvertersupportFromString in interface ObjectConverterstring - the stringcontext - context to be converted