Flying Saucer Project Release ${app.version}

org.xhtmlrenderer.css.value
Class FSCssValue

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

public class FSCssValue
extends java.lang.Object
implements org.w3c.dom.css.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.

Author:
empty

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
FSCssValue(org.w3c.dom.css.CSSPrimitiveValue primitive)
          Constructor for the FSCssValue object
FSCssValue(org.w3c.dom.css.CSSPrimitiveValue primitive, java.lang.String newValue)
          Use a given CSSPrimitiveValue, with an overriding internal text value
 
Method Summary
 org.w3c.dom.css.Counter getCounterValue()
          Not supported.
 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.
static FSCssValue getNewIdentValue(java.lang.String identValue)
           
 short getPrimitiveType()
          The type of the value as defined by the constants specified above.
 org.w3c.dom.css.Rect getRectValue()
          Not supported.
 org.w3c.dom.css.RGBColor getRGBColorValue()
          Not supported.
 java.lang.String getStringValue()
          This method is used to get the string value.
 void setCssText(java.lang.String cssText)
          Not supported, class is immutable.
 void setFloatValue(short unitType, float floatValue)
          Not supported, class is immutable.
 void setStringValue(short stringType, java.lang.String stringValue)
          Not supported, class is immutable.
 java.lang.String toString()
          Returns the string representation of the instance, in this case, the CSS text value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FSCssValue

public FSCssValue(org.w3c.dom.css.CSSPrimitiveValue primitive)
Constructor for the FSCssValue object

Parameters:
primitive - PARAM

FSCssValue

public FSCssValue(org.w3c.dom.css.CSSPrimitiveValue primitive,
                  java.lang.String newValue)
Use a given CSSPrimitiveValue, with an overriding internal text value

Parameters:
primitive - PARAM
newValue - PARAM
Method Detail

getNewIdentValue

public static FSCssValue getNewIdentValue(java.lang.String identValue)

toString

public java.lang.String toString()
Returns the string representation of the instance, in this case, the CSS text value.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object.

setCssText

public void setCssText(java.lang.String cssText)
Not supported, class is immutable. Sets the string representation of the current value.

Specified by:
setCssText in interface org.w3c.dom.css.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 org.w3c.dom.css.CSSPrimitiveValue
Parameters:
unitType - The new floatValue value
floatValue - The new floatValue value

setStringValue

public void setStringValue(short stringType,
                           java.lang.String stringValue)
Not supported, class is immutable. A method to set the string value with the specified unit.

Specified by:
setStringValue in interface org.w3c.dom.css.CSSPrimitiveValue
Parameters:
stringType - The new stringValue value
stringValue - The new stringValue value

getCssText

public java.lang.String getCssText()
A string representation of the current value.

Specified by:
getCssText in interface org.w3c.dom.css.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 org.w3c.dom.css.CSSValue
Returns:
The cssValueType value

getCounterValue

public org.w3c.dom.css.Counter getCounterValue()
Not supported. This method is used to get the Counter value.

Specified by:
getCounterValue in interface org.w3c.dom.css.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 org.w3c.dom.css.CSSPrimitiveValue
Parameters:
unitType - PARAM
Returns:
The floatValue value

getPrimitiveType

public short getPrimitiveType()
The type of the value as defined by the constants specified above.

Specified by:
getPrimitiveType in interface org.w3c.dom.css.CSSPrimitiveValue
Returns:
The primitiveType value

getRectValue

public org.w3c.dom.css.Rect getRectValue()
Not supported. This method is used to get the Rect value.

Specified by:
getRectValue in interface org.w3c.dom.css.CSSPrimitiveValue
Returns:
The rectValue value

getRGBColorValue

public org.w3c.dom.css.RGBColor getRGBColorValue()
Not supported. This method is used to get the RGB color.

Specified by:
getRGBColorValue in interface org.w3c.dom.css.CSSPrimitiveValue
Returns:
The rGBColorValue value

getStringValue

public java.lang.String getStringValue()
This method is used to get the string value.

Specified by:
getStringValue in interface org.w3c.dom.css.CSSPrimitiveValue
Returns:
The stringValue value

Flying Saucer Project Release ${app.version}

Flying Saucer Project Home