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 |
|---|---|
Object |
fromString(String string,
ConverterContext context)
Converts from String to an object.
|
protected 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(String string,
ConverterContext context)
If it supports fromString.
|
boolean |
supportToString(Object object,
ConverterContext context)
If it supports toString method.
|
String |
toString(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 String getHexString(int color)
public String toString(Object object, ConverterContext context)
ObjectConverterobject - object to be convertedcontext - converter context to be usedpublic boolean supportToString(Object object, ConverterContext context)
ObjectConverterobject - object to be convertedcontext - converter context to be usedpublic boolean supportFromString(String string, ConverterContext context)
ObjectConverterstring - the stringcontext - context to be convertedpublic Object fromString(String string, ConverterContext context)
ObjectConverterstring - the stringcontext - context to be convertedCopyright © 2017. All rights reserved.