Class EnumConverter<E extends Enum<E>>
- Type Parameters:
E- the enum type
Converter to convert a string representation of an
Enum to an Enum.- Since:
- 9
-
Nested Class Summary
Nested classes/interfaces declared in class StyleConverter
StyleConverter.StringStore -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StyleConverter<?, ?> getInstance(String ename) Gets anEnumConverterinstance for a given enum name.static StyleConverter<?, ?> readBinary(DataInputStream is, String[] strings) Reads binaryStyleConverterdata from a givenDataInputStream.Methods declared in class StyleConverter
cacheValue, clearCache, convert, convert, getBooleanConverter, getCachedValue, getColorConverter, getDurationConverter, getEffectConverter, getEnumConverter, getFontConverter, getInsetsConverter, getPaintConverter, getSizeConverter, getStringConverter, getUrlConverter, writeBinaryModifier and TypeMethodDescriptionprotected voidcacheValue(ParsedValue key, Object value) Cache the value for the specified key.static voidClear the cache.convert(Map<CssMetaData<? extends Styleable, ?>, Object> convertedValues) Convert from the constituent values to the target property type.convert(ParsedValue<String, E> value, Font font) Convert from the parsed CSS value to the target property type.static StyleConverter<String, Boolean> Return aStyleConverterthat converts "true" or "false" toBoolean.protected EGet the cached value for the specified key.static StyleConverter<String, Color> Return aStyleConverterthat converts a String representation of a web color to aColor.static StyleConverter<?, Duration> Return aStyleConverterthat converts a String representation of a duration to aDuration.static StyleConverter<ParsedValue[], Effect> Return aStyleConverterthat converts a parsed representation of anEffectto anEffectstatic <E extends Enum<E>>
StyleConverter<String, E> getEnumConverter(Class<E> enumClass) Return aStyleConverterthat converts a String representation of anEnumto anEnum.static StyleConverter<ParsedValue[], Font> Return aStyleConverterthat converts a parsed representation of aFontto anFont.static StyleConverter<ParsedValue[], Insets> Return aStyleConverterthat converts a [<length> | <percentage>]{1,4} to anInsets.static StyleConverter<ParsedValue<?, Paint>, Paint> Return aStyleConverterthat converts a parsed representation of aPaintto aPaint.static StyleConverter<?, Number> CSS length and number values are parsed into a Size object that is converted to a Number before the value is applied.static StyleConverter<String, String> A converter for quoted strings which may have embedded unicode characters.static StyleConverter<ParsedValue[], String> A converter for URL strings.voidwriteBinary(DataOutputStream os, StyleConverter.StringStore sstore) Write binary data.
-
Constructor Details
-
EnumConverter
-
-
Method Details
-
readBinary
public static StyleConverter<?,?> readBinary(DataInputStream is, String[] strings) throws IOException Reads binaryStyleConverterdata from a givenDataInputStream.- Parameters:
is-DataInputStreamto readStyleConverterdata fromstrings- string array containing StyleConverter details- Returns:
- a
StyleConverterfrom read binary data - Throws:
IOException- if reading fromDataInputStreamfails
-
getInstance
Gets anEnumConverterinstance for a given enum name.- Parameters:
ename- enum name- Returns:
- an
EnumConverterinstance for a given enum name.
-