javafx.css

## Class ParsedValue<V,T>

- java.lang.Object
- - javafx.css.ParsedValue<V,T>

-     public class ParsedValue<V,T>
      extends Object

  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&lt;String,Color&gt;` 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>` | `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.

  - ### Constructor Summary

    Constructors
    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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### value

          protected final V value

      The CSS property value as created by the parser.

    - #### converter

          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()`

  - ### 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. 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.

  - ### 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()

      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:
        The `StyleConverter` which converts the parsed value to the type of the `StyleableProperty`. May return null.

    - #### convert

          public T convert(Font font)

      Convenience method for calling `convert` on this `ParsedValue`.
      Parameters:
        `font` - The `Font` to use when converting a relative value.
      Returns:
        The value converted to the type of the `StyleableProperty`
      See Also:
        `getConverter()`

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2017, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.