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
TheCSSValueImpl
class can represent either aCSSPrimitiveValue
or aCSSValueList
so that the type can successfully change when usingsetCssText
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CSSValueImpl.CSSPrimitiveValueType
CSSPrimitiveValueType enum.static class
CSSValueImpl.CSSValueType
CSSValueType enum.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
value_
-
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 boolean
equals(java.lang.Object obj)
java.lang.String
getCssText()
CSSValueImpl.CSSValueType
getCssValueType()
double
getDoubleValue()
int
getLength()
LexicalUnit.LexicalUnitType
getLexicalUnitType()
CSSValueImpl.CSSPrimitiveValueType
getPrimitiveType()
java.lang.String
getStringValue()
java.lang.Object
getValue()
private static java.util.List<CSSValueImpl>
getValues(LexicalUnit value)
int
hashCode()
CSSValueImpl
item(int index)
void
setCssText(java.lang.String cssText)
Sets the css text.void
setDoubleValue(double doubleValue)
Sets the double value to a new value.java.lang.String
toString()
-
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.DOMException
Sets 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.DOMException
Sets 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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-