Class CSSValueImpl

java.lang.Object
org.htmlunit.cssparser.parser.AbstractLocatable
org.htmlunit.cssparser.dom.CSSValueImpl
All Implemented Interfaces:
Serializable, Locatable

public class CSSValueImpl extends AbstractLocatable implements Serializable
The CSSValueImpl class can represent either a CSSPrimitiveValue or a CSSValueList so that the type can successfully change when using setCssText.
Author:
Ronald Brill
See Also:
  • Constructor Details

    • CSSValueImpl

      public CSSValueImpl(LexicalUnit value, boolean forcePrimitive)
      Constructor.
      Parameters:
      value - the lexical unit value
      forcePrimitive - true or false
    • CSSValueImpl

      public CSSValueImpl(LexicalUnit value)
      Ctor.
      Parameters:
      value - the value
  • Method Details

    • getValue

      public Object getValue()

      getValue.

      Returns:
      the value
    • getCssText

      public String getCssText()

      getCssText.

      Returns:
      the css text
    • setCssText

      public void setCssText(String cssText) throws DOMException
      Sets the css text.
      Parameters:
      cssText - the new css text
      Throws:
      DOMException - in case of error
    • getCssValueType

      public CSSValueImpl.CSSValueType getCssValueType()

      getCssValueType.

      Returns:
      the css value type
    • getPrimitiveType

      public CSSValueImpl.CSSPrimitiveValueType getPrimitiveType()

      getPrimitiveType.

      Returns:
      the primitive type
    • getLexicalUnitType

      public LexicalUnit.LexicalUnitType getLexicalUnitType()

      getLexicalUnitType.

      Returns:
      the lexical unit type
    • setDoubleValue

      public void setDoubleValue(double doubleValue) throws DOMException
      Sets the double value to a new value.
      Parameters:
      doubleValue - the new value
      Throws:
      DOMException - in case of error
    • getDoubleValue

      public double getDoubleValue() throws DOMException

      getDoubleValue.

      Returns:
      the double value.
      Throws:
      DOMException - in case of error
    • getStringValue

      public String getStringValue() throws DOMException

      getStringValue.

      Returns:
      the string value.
      Throws:
      DOMException - case of error
    • getLength

      public int getLength()
      Returns:
      the length
      Throws:
      DOMException - in case of error
    • item

      public CSSValueImpl item(int index)

      item.

      Parameters:
      index - the position
      Returns:
      the value at the position
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object