Package org.xhtmlrenderer.css.value
Class FSCssValue
java.lang.Object
org.xhtmlrenderer.css.value.FSCssValue
- All Implemented Interfaces:
CSSPrimitiveValue
,CSSValue
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private Counter
private float
private final short
private Rect
private RGBColor
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
ConstructorsConstructorDescriptionFSCssValue
(short primitiveType, String value) FSCssValue
(CSSPrimitiveValue primitive) FSCssValue
(CSSPrimitiveValue primitive, String newValue) Use a given CSSPrimitiveValue, with an overriding internal text value -
Method Summary
Modifier and TypeMethodDescriptionNot supported.A string representation of the current value.short
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
(String identValue) short
The type of the value as defined by the constants specified above.Not supported.Not supported.This method is used to get the string value.void
setCssText
(String cssText) Not supported, class is immutable.void
setFloatValue
(short unitType, float floatValue) Not supported, class is immutable.void
setStringValue
(short stringType, String stringValue) Not supported, class is immutable.toString()
Returns the string representation of the instance, in this case, the CSS text value.
-
Field Details
-
_cssText
-
counter
-
floatValue
private float floatValue -
primitiveType
private final short primitiveType -
rectValue
-
rgbColorValue
-
-
Constructor Details
-
FSCssValue
-
FSCssValue
Use a given CSSPrimitiveValue, with an overriding internal text value -
FSCssValue
FSCssValue(short primitiveType, String value)
-
-
Method Details
-
getNewIdentValue
-
toString
Returns the string representation of the instance, in this case, the CSS text value. -
setCssText
Not supported, class is immutable. Sets the string representation of the current value.- Specified by:
setCssText
in 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:
setFloatValue
in interfaceCSSPrimitiveValue
- Parameters:
unitType
- The new floatValue valuefloatValue
- The new floatValue value
-
setStringValue
Not supported, class is immutable. A method to set the string value with the specified unit.- Specified by:
setStringValue
in interfaceCSSPrimitiveValue
- Parameters:
stringType
- The new stringValue valuestringValue
- The new stringValue value
-
getCssText
A string representation of the current value.- Specified by:
getCssText
in interfaceCSSValue
- Returns:
- The _cssText value
-
getCssValueType
public short getCssValueType()A code defining the type of the value as defined above.- Specified by:
getCssValueType
in interfaceCSSValue
- Returns:
- The cssValueType value
-
getCounterValue
Not supported. This method is used to get the Counter value.- Specified by:
getCounterValue
in 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:
getFloatValue
in interfaceCSSPrimitiveValue
-
getPrimitiveType
public short getPrimitiveType()The type of the value as defined by the constants specified above.- Specified by:
getPrimitiveType
in interfaceCSSPrimitiveValue
- Returns:
- The primitiveType value
-
getRectValue
Not supported. This method is used to get the Rect value.- Specified by:
getRectValue
in interfaceCSSPrimitiveValue
- Returns:
- The rectValue value
-
getRGBColorValue
Not supported. This method is used to get the RGB color.- Specified by:
getRGBColorValue
in interfaceCSSPrimitiveValue
- Returns:
- The rGBColorValue value
-
getStringValue
This method is used to get the string value.- Specified by:
getStringValue
in interfaceCSSPrimitiveValue
- Returns:
- The stringValue value
-