Top Description Fields Constructors Methods
javafx.css

public Class ParsedValue<V, T>

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.javafx.css.ParsedValueImpl
Type Parameters
<V>
the type of the parsed value
<T>
the type of the converted value
Imports
javafx.scene.text.Font

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

Modifier and TypeField and Description
protected final StyleConverter<V, T>
converter

The StyleConverter which converts the parsed value to the type of the StyleableProperty.

protected final V
value

The CSS property value as created by the parser.

Constructor Summary

AccessConstructor and Description
protected
ParsedValue(V
the value to be converted
value
,
StyleConverter<V, T>
the converter
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 TypeMethod and Description
public T

Returns:

The value converted to the type of the StyleableProperty
convert
(Font
The Font to use when converting a relative value.
font
)

Convenience method for calling convert on this ParsedValue.

public final StyleConverter<V, T>

Returns:

The StyleConverter which converts the parsed value to the type of the StyleableProperty. May return null.
getConverter
()

A StyleConverter converts the parsed value to the type of the StyleableProperty.

public final V

Returns:

the CSS property value
getValue
()

Gets the CSS property value as created by the parser, which may be null or otherwise incomprehensible.

public boolean

Returns:

true if this value contains a value that needs to be looked up, otherwise false
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.

public boolean

Returns:

true if value references another property, otherwise false
isLookup
()

If value references another property, then the real value needs to be looked up.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

converterback to summary
protected final StyleConverter<V, T> converter

The StyleConverter which converts the parsed value to the type of the StyleableProperty. This may be null, in which case convert will return getValue()

valueback to summary
protected final V value

The CSS property value as created by the parser.

Constructor Detail

ParsedValueback to summary
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. If 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.

Parameters
value:V

the value to be converted

converter:StyleConverter<V, T>

the converter

Method Detail

convertback to summary
public T convert(Font font)

Convenience method for calling convert on this ParsedValue.

Parameters
font:Font

The Font to use when converting a relative value.

Returns:T

The value converted to the type of the StyleableProperty

Annotations
@SuppressWarnings:unchecked
See Also
getConverter()
getConverterback to summary
public final StyleConverter<V, T> getConverter()

A StyleConverter converts the parsed value to the type of the StyleableProperty. If the StyleConverter is null, convert(javafx.scene.text.Font) will return getValue()

Returns:StyleConverter<V, T>

The StyleConverter which converts the parsed value to the type of the StyleableProperty. May return null.

getValueback to summary
public final V getValue()

Gets the CSS property value as created by the parser, which may be null or otherwise incomprehensible.

Returns:V

the CSS property value

isContainsLookupsback to summary
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:boolean

true if this value contains a value that needs to be looked up, otherwise false

Since
9
isLookupback to summary
public boolean isLookup()

If value references another property, then the real value needs to be looked up.

Returns:boolean

true if value references another property, otherwise false

Since
9