Class FSCssValue

java.lang.Object
org.xhtmlrenderer.css.value.FSCssValue
All Implemented Interfaces:
CSSPrimitiveValue, CSSValue

public class FSCssValue extends Object implements CSSPrimitiveValue
Implementation of a CSSPrimitiveValue. The main feature of this class is that on construction, values will be "normalized", so that color idents (such as 'black') are converted to valid java.awt.Color strings, and other idents are resolved as possible.
  • Field Details

    • _cssText

      private String _cssText
    • counter

      private Counter counter
    • floatValue

      private float floatValue
    • primitiveType

      private final short primitiveType
    • rectValue

      private Rect rectValue
    • rgbColorValue

      private RGBColor rgbColorValue
  • Constructor Details

    • FSCssValue

      public FSCssValue(CSSPrimitiveValue primitive)
    • FSCssValue

      public FSCssValue(CSSPrimitiveValue primitive, String newValue)
      Use a given CSSPrimitiveValue, with an overriding internal text value
    • FSCssValue

      FSCssValue(short primitiveType, String value)
  • Method Details

    • getNewIdentValue

      public static FSCssValue getNewIdentValue(String identValue)
    • toString

      public String toString()
      Returns the string representation of the instance, in this case, the CSS text value.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the object.
    • setCssText

      public void setCssText(String cssText)
      Not supported, class is immutable. Sets the string representation of the current value.
      Specified by:
      setCssText in interface CSSValue
      Parameters:
      cssText - The new cssText value
    • setFloatValue

      public void setFloatValue(short unitType, float floatValue)
      Not supported, class is immutable. A method to set the float value with a specified unit.
      Specified by:
      setFloatValue in interface CSSPrimitiveValue
      Parameters:
      unitType - The new floatValue value
      floatValue - The new floatValue value
    • setStringValue

      public void setStringValue(short stringType, String stringValue)
      Not supported, class is immutable. A method to set the string value with the specified unit.
      Specified by:
      setStringValue in interface CSSPrimitiveValue
      Parameters:
      stringType - The new stringValue value
      stringValue - The new stringValue value
    • getCssText

      public String getCssText()
      A string representation of the current value.
      Specified by:
      getCssText in interface CSSValue
      Returns:
      The _cssText value
    • getCssValueType

      public short getCssValueType()
      A code defining the type of the value as defined above.
      Specified by:
      getCssValueType in interface CSSValue
      Returns:
      The cssValueType value
    • getCounterValue

      public Counter getCounterValue()
      Not supported. This method is used to get the Counter value.
      Specified by:
      getCounterValue in interface CSSPrimitiveValue
      Returns:
      The counterValue value
    • getFloatValue

      public float getFloatValue(short unitType)
      This method is used to get a float value in a specified unit.
      Specified by:
      getFloatValue in interface CSSPrimitiveValue
    • getPrimitiveType

      public short getPrimitiveType()
      The type of the value as defined by the constants specified above.
      Specified by:
      getPrimitiveType in interface CSSPrimitiveValue
      Returns:
      The primitiveType value
    • getRectValue

      public Rect getRectValue()
      Not supported. This method is used to get the Rect value.
      Specified by:
      getRectValue in interface CSSPrimitiveValue
      Returns:
      The rectValue value
    • getRGBColorValue

      public RGBColor getRGBColorValue()
      Not supported. This method is used to get the RGB color.
      Specified by:
      getRGBColorValue in interface CSSPrimitiveValue
      Returns:
      The rGBColorValue value
    • getStringValue

      public String getStringValue()
      This method is used to get the string value.
      Specified by:
      getStringValue in interface CSSPrimitiveValue
      Returns:
      The stringValue value