|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jidesoft.converter.RangeConverter
public class RangeConverter
An abstract class that is extended by any converters that convert to/from an array-like format, such as 1, 2, 3.
Examples are Point. Point(100, 200) can convert to/from "100, 200"
You have the choice of what the separator is;
separator is the ", " in the Point example above.
| Field Summary | |
|---|---|
static ConverterContext |
CONTEXT_MULTIPLE
|
static ConverterContext |
CONTEXT_RANGE
|
| Constructor Summary | |
|---|---|
RangeConverter(Class<?> elementClass)
Creates an ArrayConverter. |
|
| Method Summary | |
|---|---|
Object[] |
arrayFromString(String string,
ConverterContext context)
Converts from string to an array of objects, using separator to separate the string. |
String |
arrayToString(Object[] objects,
ConverterContext context)
Converts from array to string by concating them with separators. |
protected Object |
fromString(int i,
String s,
ConverterContext context)
|
Object |
fromString(String string,
ConverterContext context)
Converts from String to an object. |
boolean |
supportFromString(String string,
ConverterContext context)
If it supports fromString. |
boolean |
supportToString(Object object,
ConverterContext context)
If it supports toString method. |
protected String |
toString(int i,
Object o,
ConverterContext context)
|
String |
toString(Object object,
ConverterContext context)
Converts from object to String based on current locale. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ConverterContext CONTEXT_RANGE
public static final ConverterContext CONTEXT_MULTIPLE
| Constructor Detail |
|---|
public RangeConverter(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.| Method Detail |
|---|
public String arrayToString(Object[] objects,
ConverterContext context)
objects - an array of objectscontext - converter context
protected String toString(int i,
Object o,
ConverterContext context)
public Object[] arrayFromString(String string,
ConverterContext context)
string - string to be convertedcontext - converter context
protected Object fromString(int i,
String s,
ConverterContext context)
public String toString(Object object,
ConverterContext context)
ObjectConverter
toString in interface ObjectConverterobject - object to be convertedcontext - converter context to be used
public boolean supportToString(Object object,
ConverterContext context)
ObjectConverter
supportToString in interface ObjectConverterobject - object to be convertedcontext - converter context to be used
public Object fromString(String string,
ConverterContext context)
ObjectConverter
fromString in interface ObjectConverterstring - the stringcontext - context to be converted
public boolean supportFromString(String string,
ConverterContext context)
ObjectConverter
supportFromString in interface ObjectConverterstring - the stringcontext - context to be converted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||