public class RgbColorConverter extends ColorConverter
CONTEXT_HEX, CONTEXT_HEX_WITH_ALPHA, CONTEXT_RGB, CONTEXT_RGBA
Constructor and Description |
---|
RgbColorConverter()
Creates a RgbColorConverter.
|
RgbColorConverter(boolean alphaIncluded)
Creates a RgbColorConverter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
fromString(java.lang.String string,
ConverterContext context)
Converts from String to an object.
|
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 RgbColorConverter()
public RgbColorConverter(boolean alphaIncluded)
alphaIncluded
- the flag if alpha value will be included in this converterpublic boolean isAlphaIncluded()
RgbColorConverter}
public void setAlphaIncluded(boolean alphaIncluded)
alphaIncluded
- the flag if this converter should consider alpha value.#isAlphaIncluded()}
public java.lang.String toString(java.lang.Object object, ConverterContext context)
ObjectConverter
object
- object to be convertedcontext
- converter context to be usedpublic boolean supportToString(java.lang.Object object, ConverterContext context)
ObjectConverter
object
- object to be convertedcontext
- converter context to be usedpublic boolean supportFromString(java.lang.String string, ConverterContext context)
ObjectConverter
string
- the stringcontext
- context to be convertedpublic java.lang.Object fromString(java.lang.String string, ConverterContext context)
ObjectConverter
string
- the stringcontext
- context to be converted