Package org.htmlunit.cssparser.dom
Class CSSValueImpl
- java.lang.Object
-
- org.htmlunit.cssparser.parser.AbstractLocatable
-
- org.htmlunit.cssparser.dom.CSSValueImpl
-
- All Implemented Interfaces:
Serializable,Locatable
public class CSSValueImpl extends AbstractLocatable implements Serializable
TheCSSValueImplclass can represent either aCSSPrimitiveValueor aCSSValueListso that the type can successfully change when usingsetCssText.- Author:
- Ronald Brill
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCSSValueImpl.CSSPrimitiveValueTypeCSSPrimitiveValueType enum.static classCSSValueImpl.CSSValueTypeCSSValueType enum.
-
Constructor Summary
Constructors Constructor Description CSSValueImpl(LexicalUnit value)Ctor.CSSValueImpl(LexicalUnit value, boolean forcePrimitive)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetCssText()getCssText.CSSValueImpl.CSSValueTypegetCssValueType()getCssValueType.doublegetDoubleValue()getDoubleValue.intgetLength()LexicalUnit.LexicalUnitTypegetLexicalUnitType()getLexicalUnitType.CSSValueImpl.CSSPrimitiveValueTypegetPrimitiveType()getPrimitiveType.StringgetStringValue()getStringValue.ObjectgetValue()getValue.inthashCode()CSSValueImplitem(int index)item.voidsetCssText(String cssText)Sets the css text.voidsetDoubleValue(double doubleValue)Sets the double value to a new value.StringtoString()-
Methods inherited from class org.htmlunit.cssparser.parser.AbstractLocatable
getLocator, setLocator
-
-
-
-
Constructor Detail
-
CSSValueImpl
public CSSValueImpl(LexicalUnit value, boolean forcePrimitive)
Constructor.- Parameters:
value- the lexical unit valueforcePrimitive- true or false
-
CSSValueImpl
public CSSValueImpl(LexicalUnit value)
Ctor.- Parameters:
value- the value
-
-
Method Detail
-
getValue
public Object getValue()
getValue.
- Returns:
- the value
-
getCssText
public String getCssText()
getCssText.
- Returns:
- the css text
-
setCssText
public void setCssText(String cssText) throws DOMException
Sets the css text.- Parameters:
cssText- the new css text- Throws:
DOMException- in case of error
-
getCssValueType
public CSSValueImpl.CSSValueType getCssValueType()
getCssValueType.
- Returns:
- the css value type
-
getPrimitiveType
public CSSValueImpl.CSSPrimitiveValueType getPrimitiveType()
getPrimitiveType.
- Returns:
- the primitive type
-
getLexicalUnitType
public LexicalUnit.LexicalUnitType getLexicalUnitType()
getLexicalUnitType.
- Returns:
- the lexical unit type
-
setDoubleValue
public void setDoubleValue(double doubleValue) throws DOMExceptionSets the double value to a new value.- Parameters:
doubleValue- the new value- Throws:
DOMException- in case of error
-
getDoubleValue
public double getDoubleValue() throws DOMExceptiongetDoubleValue.
- Returns:
- the double value.
- Throws:
DOMException- in case of error
-
getStringValue
public String getStringValue() throws DOMException
getStringValue.
- Returns:
- the string value.
- Throws:
DOMException- case of error
-
getLength
public int getLength()
- Returns:
- the length
- Throws:
DOMException- in case of error
-
item
public CSSValueImpl item(int index)
item.
- Parameters:
index- the position- Returns:
- the value at the position
-
-