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.
Modifier and Type | Field and Description |
---|---|
protected StyleConverter<V,T> |
converter
The
StyleConverter which converts the parsed value to
the type of the StyleableProperty . |
protected V |
value
The CSS property value as created by the parser.
|
Modifier | Constructor and Description |
---|---|
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.
|
Modifier and Type | Method and Description |
---|---|
T |
convert(Font font)
Convenience method for calling
convert
on this ParsedValue . |
StyleConverter<V,T> |
getConverter()
A
StyleConverter converts the parsed value to
the type of the StyleableProperty . |
V |
getValue() |
protected final V value
protected final StyleConverter<V,T> converter
StyleConverter
which converts the parsed value to
the type of the StyleableProperty
. This may be null, in which
case convert
will return getValue()
protected ParsedValue(V value, StyleConverter<V,T> converter)
converter
is null, then it is assumed that the type of value
V
and the type of target T
are the same and
do not need converted.public final V getValue()
public final StyleConverter<V,T> getConverter()
StyleConverter
converts the parsed value to
the type of the StyleableProperty
. If the StyleConverter
is null, convert(javafx.scene.text.Font)
will return getValue()
StyleConverter
which converts the parsed value to
the type of the StyleableProperty
. May return null.public T convert(Font font)
convert
on this ParsedValue
.font
- The Font
to use when converting a
relative
value.StyleableProperty
getConverter()
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.