Class CSSValueImpl

  • All Implemented Interfaces:
    CSSOMObject, java.io.Serializable, org.w3c.dom.css.CSSPrimitiveValue, org.w3c.dom.css.CSSValue, org.w3c.dom.css.CSSValueList

    public class CSSValueImpl
    extends CSSOMObjectImpl
    implements org.w3c.dom.css.CSSPrimitiveValue, org.w3c.dom.css.CSSValueList, java.io.Serializable
    The CSSValueImpl class can represent either a CSSPrimitiveValue or a CSSValueList so that the type can successfully change when using setCssText. TODO: Float unit conversions, A means of checking valid primitive types for properties
    Version:
    $Id: CSSValueImpl.java,v 1.3 2008/03/26 02:08:55 sdanig Exp $
    Author:
    David Schweinsberg
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from interface org.w3c.dom.css.CSSPrimitiveValue

        CSS_ATTR, CSS_CM, CSS_COUNTER, CSS_DEG, CSS_DIMENSION, CSS_EMS, CSS_EXS, CSS_GRAD, CSS_HZ, CSS_IDENT, CSS_IN, CSS_KHZ, CSS_MM, CSS_MS, CSS_NUMBER, CSS_PC, CSS_PERCENTAGE, CSS_PT, CSS_PX, CSS_RAD, CSS_RECT, CSS_RGBCOLOR, CSS_S, CSS_STRING, CSS_UNKNOWN, CSS_URI
      • Fields inherited from interface org.w3c.dom.css.CSSValue

        CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST
    • Constructor Summary

      Constructors 
      Constructor Description
      CSSValueImpl()  
      CSSValueImpl​(org.w3c.css.sac.LexicalUnit value)  
      CSSValueImpl​(org.w3c.css.sac.LexicalUnit value, boolean forcePrimitive)
      Constructor
    • Constructor Detail

      • CSSValueImpl

        public CSSValueImpl​(org.w3c.css.sac.LexicalUnit value,
                            boolean forcePrimitive)
        Constructor
      • CSSValueImpl

        public CSSValueImpl()
      • CSSValueImpl

        public CSSValueImpl​(org.w3c.css.sac.LexicalUnit value)
    • Method Detail

      • getValue

        public java.lang.Object getValue()
      • setValue

        public void setValue​(java.lang.Object value)
      • getCssText

        public java.lang.String getCssText()
        Specified by:
        getCssText in interface org.w3c.dom.css.CSSValue
      • setCssText

        public void setCssText​(java.lang.String cssText)
                        throws org.w3c.dom.DOMException
        Specified by:
        setCssText in interface org.w3c.dom.css.CSSValue
        Throws:
        org.w3c.dom.DOMException
      • getCssValueType

        public short getCssValueType()
        Specified by:
        getCssValueType in interface org.w3c.dom.css.CSSValue
      • getPrimitiveType

        public short getPrimitiveType()
        Specified by:
        getPrimitiveType in interface org.w3c.dom.css.CSSPrimitiveValue
      • setFloatValue

        public void setFloatValue​(short unitType,
                                  float floatValue)
                           throws org.w3c.dom.DOMException
        Specified by:
        setFloatValue in interface org.w3c.dom.css.CSSPrimitiveValue
        Throws:
        org.w3c.dom.DOMException
      • getFloatValue

        public float getFloatValue​(short unitType)
                            throws org.w3c.dom.DOMException
        Specified by:
        getFloatValue in interface org.w3c.dom.css.CSSPrimitiveValue
        Throws:
        org.w3c.dom.DOMException
      • setStringValue

        public void setStringValue​(short stringType,
                                   java.lang.String stringValue)
                            throws org.w3c.dom.DOMException
        Specified by:
        setStringValue in interface org.w3c.dom.css.CSSPrimitiveValue
        Throws:
        org.w3c.dom.DOMException
      • getStringValue

        public java.lang.String getStringValue()
                                        throws org.w3c.dom.DOMException
        TODO: return a value for a list type
        Specified by:
        getStringValue in interface org.w3c.dom.css.CSSPrimitiveValue
        Throws:
        org.w3c.dom.DOMException
      • getCounterValue

        public org.w3c.dom.css.Counter getCounterValue()
                                                throws org.w3c.dom.DOMException
        Specified by:
        getCounterValue in interface org.w3c.dom.css.CSSPrimitiveValue
        Throws:
        org.w3c.dom.DOMException
      • getRectValue

        public org.w3c.dom.css.Rect getRectValue()
                                          throws org.w3c.dom.DOMException
        Specified by:
        getRectValue in interface org.w3c.dom.css.CSSPrimitiveValue
        Throws:
        org.w3c.dom.DOMException
      • getRGBColorValue

        public org.w3c.dom.css.RGBColor getRGBColorValue()
                                                  throws org.w3c.dom.DOMException
        Specified by:
        getRGBColorValue in interface org.w3c.dom.css.CSSPrimitiveValue
        Throws:
        org.w3c.dom.DOMException
      • getLength

        public int getLength()
        Specified by:
        getLength in interface org.w3c.dom.css.CSSValueList
      • item

        public org.w3c.dom.css.CSSValue item​(int index)
        Specified by:
        item in interface org.w3c.dom.css.CSSValueList
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object