java.lang.Object
javafx.css.ParsedValue<V,T>
A representation of a parsed CSS value.
V is the type of the parsed
value, T is the StyleableProperty type of the converted value.
Instances of ParsedValue are created by the CSS parser. For example,
the parser creates a ParsedValue<String,Color> when it parses a
web Color.
A ParsedValue is meaningful to the code that calculates actual values from
parsed CSS values. Elsewhere the value returned by
getValue() is likely to be obscure, abstruse and perplexing.
- Since:
- JavaFX 8.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StyleConverter<V, T> TheStyleConverterwhich converts the parsed value to the type of theStyleableProperty.protected final VThe CSS property value as created by the parser. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedParsedValue(V value, StyleConverter<V, T> converter) Create an instance of ParsedValue where the value type V is converted to the target type T using the given converter. -
Method Summary
Modifier and TypeMethodDescriptionConvenience method for callingconverton thisParsedValue.final StyleConverter<V, T> AStyleConverterconverts the parsed value to the type of theStyleableProperty.final VgetValue()Gets the CSS property value as created by the parser, which may be null or otherwise incomprehensible.booleanIf value is itself a ParsedValue or sequence of values, and should any of those values need to be looked up, then this flag is set.booleanisLookup()If value references another property, then the real value needs to be looked up.
-
Field Details
-
value
The CSS property value as created by the parser. -
converter
TheStyleConverterwhich converts the parsed value to the type of theStyleableProperty. This may be null, in which caseconvertwill returngetValue()
-
-
Constructor Details
-
ParsedValue
Create an instance of ParsedValue where the value type V is converted to the target type T using the given converter. Ifconverteris null, then it is assumed that the type of valueVand the type of targetTare the same and do not need converted.- Parameters:
value- the value to be convertedconverter- the converter
-
-
Method Details
-
getValue
Gets the CSS property value as created by the parser, which may be null or otherwise incomprehensible.- Returns:
- the CSS property value
-
getConverter
AStyleConverterconverts the parsed value to the type of theStyleableProperty. If theStyleConverteris null,convert(javafx.scene.text.Font)will returngetValue()- Returns:
- The
StyleConverterwhich converts the parsed value to the type of theStyleableProperty. May return null.
-
convert
Convenience method for callingconverton thisParsedValue.- Parameters:
font- TheFontto use when converting a relative value.- Returns:
- The value converted to the type of the
StyleableProperty - See Also:
-
isContainsLookups
public boolean isContainsLookups()If value is itself a ParsedValue or sequence of values, and should any of those values need to be looked up, then this flag is set. This does not mean that this particular value needs to be looked up, but that this value contains a value that needs to be looked up.- Returns:
- true if this value contains a value that needs to be looked up, otherwise false
- Since:
- 9
-
isLookup
public boolean isLookup()If value references another property, then the real value needs to be looked up.- Returns:
- true if value references another property, otherwise false
- Since:
- 9
-