|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.properties.converter.AbstractConverter
org.xwiki.properties.converter.AbstractCollectionConverter
public abstract class AbstractCollectionConverter
Base class for all Collection converters.
| Field Summary | |
|---|---|
protected static char |
QUOTECHAR
Quote char. |
protected static String |
QUOTESTRING
Quote string. |
| Constructor Summary | |
|---|---|
AbstractCollectionConverter()
|
|
| Method Summary | ||
|---|---|---|
protected String |
convertToString(Object value)
Convert the input object into a String. |
|
protected
|
convertToType(Type targetType,
Object value)
Convert the input object into an output object of the specified type. |
|
protected StreamTokenizer |
createStreamTokenizer(String value)
Create and initializer a StreamTokenizer to parse the value. |
|
ConverterManager |
getConverterManager()
|
|
char |
getDelimiter()
|
|
protected Collection |
newCollection()
|
|
protected Collection |
parseElements(String value,
Type genericType)
Parse an incoming String of the form similar to an array initializer in the Java language into a List individual Strings for each element, according to the following rules. |
|
void |
setAllowedChars(char[] allowedChars)
Set the allowed characters to be used for parsing a delimited String. |
|
void |
setDelimiter(char delimiter)
Set the delimiter to be used for parsing a delimited String. |
|
| Methods inherited from class org.xwiki.properties.converter.AbstractConverter |
|---|
convert, convertToType |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final char QUOTECHAR
protected static final String QUOTESTRING
| Constructor Detail |
|---|
public AbstractCollectionConverter()
| Method Detail |
|---|
public ConverterManager getConverterManager()
public void setDelimiter(char delimiter)
delimiter - The delimiter [default ',']public char getDelimiter()
public void setAllowedChars(char[] allowedChars)
allowedChars - Characters which are to be considered as part of the tokens when parsing a delimited String
[default is '.' and '-']
protected <T> T convertToType(Type targetType,
Object value)
AbstractConverter
Typical implementations will provide a minimum of String --> type conversion.
convertToType in class AbstractConverterT - the type in which the provided value has o be convertedtargetType - Data type to which this value should be converted.value - The input value to be converted.
protected Collection parseElements(String value,
Type genericType)
Parse an incoming String of the form similar to an array initializer in the Java language into a
List individual Strings for each element, according to the following rules.
value - String value to be parsedgenericType - the generic type
ConversionException - if the syntax of value is not syntactically valid
NullPointerException - if value is nullprotected Collection newCollection()
Collection to fillprotected StreamTokenizer createStreamTokenizer(String value)
StreamTokenizer to parse the value.
value - the string to parse
StreamTokenizer used to parse the stringprotected String convertToString(Object value)
N.B.This implementation simply uses the value's toString() method and should be overriden if
a more sophisticated mechanism for conversion to a String is required.
convertToString in class AbstractConvertervalue - The input value to be converted.
AbstractConverter.convertToString(java.lang.Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||