Package org.xhtmlrenderer.css.value
Class FSCssValue
- java.lang.Object
-
- org.xhtmlrenderer.css.value.FSCssValue
-
- All Implemented Interfaces:
CSSPrimitiveValue,CSSValue
public class FSCssValue extends Object implements CSSPrimitiveValue
Implementation of aCSSPrimitiveValue. 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
Constructors Constructor Description FSCssValue(CSSPrimitiveValue primitive)FSCssValue(CSSPrimitiveValue primitive, String newValue)Use a given CSSPrimitiveValue, with an overriding internal text value
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CountergetCounterValue()Not supported.StringgetCssText()A string representation of the current value.shortgetCssValueType()A code defining the type of the value as defined above.floatgetFloatValue(short unitType)This method is used to get a float value in a specified unit.static FSCssValuegetNewIdentValue(String identValue)shortgetPrimitiveType()The type of the value as defined by the constants specified above.RectgetRectValue()Not supported.RGBColorgetRGBColorValue()Not supported.StringgetStringValue()This method is used to get the string value.voidsetCssText(String cssText)Not supported, class is immutable.voidsetFloatValue(short unitType, float floatValue)Not supported, class is immutable.voidsetStringValue(short stringType, String stringValue)Not supported, class is immutable.StringtoString()Returns the string representation of the instance, in this case, the CSS text value.
-
-
-
Constructor Detail
-
FSCssValue
public FSCssValue(CSSPrimitiveValue primitive)
-
FSCssValue
public FSCssValue(CSSPrimitiveValue primitive, String newValue)
Use a given CSSPrimitiveValue, with an overriding internal text value
-
-
Method Detail
-
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.
-
setCssText
public void setCssText(String cssText)
Not supported, class is immutable. Sets the string representation of the current value.- Specified by:
setCssTextin interfaceCSSValue- 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:
setFloatValuein interfaceCSSPrimitiveValue- Parameters:
unitType- The new floatValue valuefloatValue- 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:
setStringValuein interfaceCSSPrimitiveValue- Parameters:
stringType- The new stringValue valuestringValue- The new stringValue value
-
getCssText
public String getCssText()
A string representation of the current value.- Specified by:
getCssTextin interfaceCSSValue- Returns:
- The _cssText value
-
getCssValueType
public short getCssValueType()
A code defining the type of the value as defined above.- Specified by:
getCssValueTypein interfaceCSSValue- Returns:
- The cssValueType value
-
getCounterValue
public Counter getCounterValue()
Not supported. This method is used to get the Counter value.- Specified by:
getCounterValuein interfaceCSSPrimitiveValue- 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:
getFloatValuein interfaceCSSPrimitiveValue
-
getPrimitiveType
public short getPrimitiveType()
The type of the value as defined by the constants specified above.- Specified by:
getPrimitiveTypein interfaceCSSPrimitiveValue- Returns:
- The primitiveType value
-
getRectValue
public Rect getRectValue()
Not supported. This method is used to get the Rect value.- Specified by:
getRectValuein interfaceCSSPrimitiveValue- Returns:
- The rectValue value
-
getRGBColorValue
public RGBColor getRGBColorValue()
Not supported. This method is used to get the RGB color.- Specified by:
getRGBColorValuein interfaceCSSPrimitiveValue- Returns:
- The rGBColorValue value
-
getStringValue
public String getStringValue()
This method is used to get the string value.- Specified by:
getStringValuein interfaceCSSPrimitiveValue- Returns:
- The stringValue value
-
-