Class ParsedValue<V,T>
- javafx.css.ParsedValue<V,T>
public class ParsedValue<V,T> extends Object
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
Fields Modifier and Type Field and Description protected StyleConverter<V,T>converterTheStyleConverterwhich converts the parsed value to the type of theStyleableProperty.protected VvalueThe CSS property value as created by the parser.
-
Constructor Summary
Constructors Modifier Constructor and Description protectedParsedValue(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
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description Tconvert(Font font)Convenience method for callingconverton thisParsedValue.StyleConverter<V,T>getConverter()AStyleConverterconverts the parsed value to the type of theStyleableProperty.VgetValue()
-
Field Detail
-
value
protected final V value
The CSS property value as created by the parser.
-
converter
protected final StyleConverter<V,T> converter
TheStyleConverterwhich converts the parsed value to the type of theStyleableProperty. This may be null, in which caseconvertwill returngetValue()
-
-
Constructor Detail
-
ParsedValue
protected ParsedValue(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. Ifconverteris null, then it is assumed that the type of valueVand the type of targetTare the same and do not need converted.
-
-
Method Detail
-
getValue
public final V getValue()
Returns:
The CSS property value as created by the parser, which may be null or otherwise incomprehensible.
-
getConverter
public final StyleConverter<V,T> 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
public T convert(Font font)
Convenience method for callingconverton thisParsedValue.Returns:
The value converted to the type of the
StyleablePropertySee Also:
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.