public class HexColorConverter extends ColorConverter
CONTEXT_HEX, CONTEXT_HEX_WITH_ALPHA, CONTEXT_RGB, CONTEXT_RGBA| Constructor and Description |
|---|
HexColorConverter()
Creates a HexColorConverter.
|
HexColorConverter(boolean alphaIncluded)
Creates a HexColorConverter.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
fromString(java.lang.String string,
ConverterContext context)
Converts from String to an object.
|
protected java.lang.String |
getHexString(int color) |
boolean |
isAlphaIncluded()
Get the flag if this converter should consider alpha value.
|
void |
setAlphaIncluded(boolean alphaIncluded)
Set the flag if this converter should consider alpha value.
|
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.
|
java.lang.String |
toString(java.lang.Object object,
ConverterContext context)
Converts from object to String based on current locale.
|
public HexColorConverter()
public HexColorConverter(boolean alphaIncluded)
alphaIncluded - the flag if alpha value will be included in this converterpublic boolean isAlphaIncluded()
HexColorConverterpublic void setAlphaIncluded(boolean alphaIncluded)
alphaIncluded - the flag if this converter should consider alpha value.isAlphaIncluded()protected java.lang.String getHexString(int color)
public java.lang.String toString(java.lang.Object object,
ConverterContext context)
ObjectConverterobject - object to be convertedcontext - converter context to be usedpublic boolean supportToString(java.lang.Object object,
ConverterContext context)
ObjectConverterobject - object to be convertedcontext - converter context to be usedpublic boolean supportFromString(java.lang.String string,
ConverterContext context)
ObjectConverterstring - the stringcontext - context to be convertedpublic java.lang.Object fromString(java.lang.String string,
ConverterContext context)
ObjectConverterstring - the stringcontext - context to be converted