public class CSSValueImpl extends CSSOMObjectImpl implements org.w3c.dom.css.CSSPrimitiveValue, org.w3c.dom.css.CSSValueList, CSSFormatable
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 propertiesCSS_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
CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST
Constructor and Description |
---|
CSSValueImpl() |
CSSValueImpl(org.w3c.css.sac.LexicalUnit value) |
CSSValueImpl(org.w3c.css.sac.LexicalUnit value,
boolean forcePrimitive)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
org.w3c.dom.css.Counter |
getCounterValue() |
String |
getCssText() |
String |
getCssText(CSSFormat format)
Returns a string representation of the rule based on the given format.
|
short |
getCssValueType() |
float |
getFloatValue(short unitType) |
int |
getLength() |
short |
getPrimitiveType() |
org.w3c.dom.css.Rect |
getRectValue() |
org.w3c.dom.css.RGBColor |
getRGBColorValue() |
String |
getStringValue()
TODO: return a value for a list type
|
Object |
getValue() |
int |
hashCode() |
org.w3c.dom.css.CSSValue |
item(int index) |
void |
setCssText(String cssText) |
void |
setFloatValue(short unitType,
float floatValue) |
void |
setStringValue(short stringType,
String stringValue) |
void |
setValue(Object value) |
String |
toString() |
getUserData, getUserDataMap, setUserData, setUserDataMap
public CSSValueImpl(org.w3c.css.sac.LexicalUnit value, boolean forcePrimitive)
public CSSValueImpl()
public CSSValueImpl(org.w3c.css.sac.LexicalUnit value)
public Object getValue()
public void setValue(Object value)
public String getCssText()
getCssText
in interface org.w3c.dom.css.CSSValue
public String getCssText(CSSFormat format)
getCssText
in interface CSSFormatable
format
- the formatting rulespublic void setCssText(String cssText) throws DOMException
setCssText
in interface org.w3c.dom.css.CSSValue
DOMException
public short getCssValueType()
getCssValueType
in interface org.w3c.dom.css.CSSValue
public short getPrimitiveType()
getPrimitiveType
in interface org.w3c.dom.css.CSSPrimitiveValue
public void setFloatValue(short unitType, float floatValue) throws DOMException
setFloatValue
in interface org.w3c.dom.css.CSSPrimitiveValue
DOMException
public float getFloatValue(short unitType) throws DOMException
getFloatValue
in interface org.w3c.dom.css.CSSPrimitiveValue
DOMException
public void setStringValue(short stringType, String stringValue) throws DOMException
setStringValue
in interface org.w3c.dom.css.CSSPrimitiveValue
DOMException
public String getStringValue() throws DOMException
getStringValue
in interface org.w3c.dom.css.CSSPrimitiveValue
DOMException
public org.w3c.dom.css.Counter getCounterValue() throws DOMException
getCounterValue
in interface org.w3c.dom.css.CSSPrimitiveValue
DOMException
public org.w3c.dom.css.Rect getRectValue() throws DOMException
getRectValue
in interface org.w3c.dom.css.CSSPrimitiveValue
DOMException
public org.w3c.dom.css.RGBColor getRGBColorValue() throws DOMException
getRGBColorValue
in interface org.w3c.dom.css.CSSPrimitiveValue
DOMException
public int getLength()
getLength
in interface org.w3c.dom.css.CSSValueList
public org.w3c.dom.css.CSSValue item(int index)
item
in interface org.w3c.dom.css.CSSValueList
public boolean equals(Object obj)
equals
in class CSSOMObjectImpl
public int hashCode()
hashCode
in class CSSOMObjectImpl
Copyright © 1999–2017. All rights reserved.