Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.steadystate.css.dom
Class CSSValueImpl  view CSSValueImpl download CSSValueImpl.java

java.lang.Object
  extended bycom.steadystate.css.dom.CSSValueImpl
All Implemented Interfaces:
org.w3c.dom.css.CSSPrimitiveValue, org.w3c.dom.css.CSSValue, org.w3c.dom.css.CSSValueList, java.io.Serializable

public class CSSValueImpl
extends java.lang.Object
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. TO DO: Float unit conversions, A means of checking valid primitive types for properties

Version:
$Release$

Field Summary
private  java.lang.Object _value
           
 
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
CSSValueImpl(org.w3c.css.sac.LexicalUnit value)
           
CSSValueImpl(org.w3c.css.sac.LexicalUnit value, boolean forcePrimitive)
          Constructor
 
Method Summary
 org.w3c.dom.css.Counter getCounterValue()
          This method is used to get the Counter value.
 java.lang.String getCssText()
          A string representation of the current value.
 short getCssValueType()
          A code defining the type of the value as defined above.
 float getFloatValue(short unitType)
          This method is used to get a float value in a specified unit.
 int getLength()
          The number of CSSValues in the list.
 short getPrimitiveType()
          The type of the value as defined by the constants specified above.
 org.w3c.dom.css.Rect getRectValue()
          This method is used to get the Rect value.
 org.w3c.dom.css.RGBColor getRGBColorValue()
          This method is used to get the RGB color.
 java.lang.String getStringValue()
          TODO: return a value for a list type
 org.w3c.dom.css.CSSValue item(int index)
          Used to retrieve a CSSValue by ordinal index.
 void setCssText(java.lang.String cssText)
          A string representation of the current value.
 void setFloatValue(short unitType, float floatValue)
          A method to set the float value with a specified unit.
 void setStringValue(short stringType, java.lang.String stringValue)
          A method to set the string value with the specified unit.
 java.lang.String toString()
          Convert this Object to a human-readable String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_value

private java.lang.Object _value
Constructor Detail

CSSValueImpl

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


CSSValueImpl

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

getCssText

public java.lang.String getCssText()
Description copied from interface: org.w3c.dom.css.CSSValue
A string representation of the current value.

Specified by:
getCssText in interface org.w3c.dom.css.CSSValue

setCssText

public void setCssText(java.lang.String cssText)
                throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSValue
A string representation of the current value.

Specified by:
setCssText in interface org.w3c.dom.css.CSSValue

getCssValueType

public short getCssValueType()
Description copied from interface: org.w3c.dom.css.CSSValue
A code defining the type of the value as defined above.

Specified by:
getCssValueType in interface org.w3c.dom.css.CSSValue

getPrimitiveType

public short getPrimitiveType()
Description copied from interface: org.w3c.dom.css.CSSPrimitiveValue
The type of the value as defined by the constants specified above.

Specified by:
getPrimitiveType in interface org.w3c.dom.css.CSSPrimitiveValue

setFloatValue

public void setFloatValue(short unitType,
                          float floatValue)
                   throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSPrimitiveValue
A method to set the float value with a specified unit. If the property attached with this value can not accept the specified unit or the float value, the value will be unchanged and a DOMException will be raised.

Specified by:
setFloatValue in interface org.w3c.dom.css.CSSPrimitiveValue

getFloatValue

public float getFloatValue(short unitType)
                    throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSPrimitiveValue
This method is used to get a float value in a specified unit. If this CSS value doesn't contain a float value or can't be converted into the specified unit, a DOMException is raised.

Specified by:
getFloatValue in interface org.w3c.dom.css.CSSPrimitiveValue

setStringValue

public void setStringValue(short stringType,
                           java.lang.String stringValue)
                    throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSPrimitiveValue
A method to set the string value with the specified unit. If the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a DOMException will be raised.

Specified by:
setStringValue in interface org.w3c.dom.css.CSSPrimitiveValue

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

getCounterValue

public org.w3c.dom.css.Counter getCounterValue()
                                        throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSPrimitiveValue
This method is used to get the Counter value. If this CSS value doesn't contain a counter value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Counter interface.

Specified by:
getCounterValue in interface org.w3c.dom.css.CSSPrimitiveValue

getRectValue

public org.w3c.dom.css.Rect getRectValue()
                                  throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSPrimitiveValue
This method is used to get the Rect value. If this CSS value doesn't contain a rect value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Rect interface.

Specified by:
getRectValue in interface org.w3c.dom.css.CSSPrimitiveValue

getRGBColorValue

public org.w3c.dom.css.RGBColor getRGBColorValue()
                                          throws org.w3c.dom.DOMException
Description copied from interface: org.w3c.dom.css.CSSPrimitiveValue
This method is used to get the RGB color. If this CSS value doesn't contain a RGB color value, a DOMException is raised. Modification to the corresponding style property can be achieved using the RGBColor interface.

Specified by:
getRGBColorValue in interface org.w3c.dom.css.CSSPrimitiveValue

getLength

public int getLength()
Description copied from interface: org.w3c.dom.css.CSSValueList
The number of CSSValues in the list. The range of valid values of the indices is 0 to length-1 inclusive.

Specified by:
getLength in interface org.w3c.dom.css.CSSValueList

item

public org.w3c.dom.css.CSSValue item(int index)
Description copied from interface: org.w3c.dom.css.CSSValueList
Used to retrieve a CSSValue by ordinal index. The order in this collection represents the order of the values in the CSS style property. If index is greater than or equal to the number of values in the list, this returns null.

Specified by:
item in interface org.w3c.dom.css.CSSValueList

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).