Package org.htmlunit.cssparser.dom
Class CSSValueImpl
- java.lang.Object
-
- org.htmlunit.cssparser.parser.AbstractLocatable
-
- org.htmlunit.cssparser.dom.CSSValueImpl
-
- All Implemented Interfaces:
java.io.Serializable,Locatable
public class CSSValueImpl extends AbstractLocatable implements java.io.Serializable
TheCSSValueImplclass can represent either aCSSPrimitiveValueor aCSSValueListso that the type can successfully change when usingsetCssText.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCSSValueImpl.CSSPrimitiveValueTypeCSSPrimitiveValueType enum.static classCSSValueImpl.CSSValueTypeCSSValueType enum.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Objectvalue_
-
Constructor Summary
Constructors Constructor Description CSSValueImpl(LexicalUnit value)Ctor.CSSValueImpl(LexicalUnit value, boolean forcePrimitive)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.StringgetCssText()CSSValueImpl.CSSValueTypegetCssValueType()doublegetDoubleValue()intgetLength()LexicalUnit.LexicalUnitTypegetLexicalUnitType()CSSValueImpl.CSSPrimitiveValueTypegetPrimitiveType()java.lang.StringgetStringValue()java.lang.ObjectgetValue()private static java.util.List<CSSValueImpl>getValues(LexicalUnit value)inthashCode()CSSValueImplitem(int index)voidsetCssText(java.lang.String cssText)Sets the css text.voidsetDoubleValue(double doubleValue)Sets the double value to a new value.java.lang.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 java.lang.Object getValue()
- Returns:
- the value
-
getValues
private static java.util.List<CSSValueImpl> getValues(LexicalUnit value)
-
getCssText
public java.lang.String getCssText()
- Returns:
- the css text
-
setCssText
public void setCssText(java.lang.String cssText) throws org.w3c.dom.DOMExceptionSets the css text.- Parameters:
cssText- the new css text- Throws:
org.w3c.dom.DOMException- in case of error
-
getCssValueType
public CSSValueImpl.CSSValueType getCssValueType()
- Returns:
- the css value type
-
getPrimitiveType
public CSSValueImpl.CSSPrimitiveValueType getPrimitiveType()
- Returns:
- the primitive type
-
getLexicalUnitType
public LexicalUnit.LexicalUnitType getLexicalUnitType()
- Returns:
- the lexical unit type
-
setDoubleValue
public void setDoubleValue(double doubleValue) throws org.w3c.dom.DOMExceptionSets the double value to a new value.- Parameters:
doubleValue- the new value- Throws:
org.w3c.dom.DOMException- in case of error
-
getDoubleValue
public double getDoubleValue() throws org.w3c.dom.DOMException- Returns:
- the double value.
- Throws:
org.w3c.dom.DOMException- in case of error
-
getStringValue
public java.lang.String getStringValue() throws org.w3c.dom.DOMException- Returns:
- the string value.
- Throws:
org.w3c.dom.DOMException- case of error
-
getLength
public int getLength()
- Returns:
- the length
- Throws:
org.w3c.dom.DOMException- in case of error
-
item
public CSSValueImpl item(int index)
- Parameters:
index- the position- Returns:
- the value at the position
- Throws:
org.w3c.dom.DOMException- in case of error
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-