Package org.htmlunit.cssparser.dom
Class CSSStyleDeclarationImpl
- java.lang.Object
-
- org.htmlunit.cssparser.dom.CSSStyleDeclarationImpl
-
- All Implemented Interfaces:
java.io.Serializable
public class CSSStyleDeclarationImpl extends java.lang.Object implements java.io.SerializableImplementation of CSSStyleDeclaration.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractCSSRuleImplparentRule_private static java.lang.StringPRIORITY_IMPORTANTprivate java.util.List<Property>properties_
-
Constructor Summary
Constructors Constructor Description CSSStyleDeclarationImpl(AbstractCSSRuleImpl parentRule)Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(Property p)Add a property.booleanequals(java.lang.Object obj)private booleanequalsProperties(CSSStyleDeclarationImpl csd)java.lang.StringgetCssText()intgetLength()AbstractCSSRuleImplgetParentRule()java.util.List<Property>getProperties()CSSValueImplgetPropertyCSSValue(java.lang.String propertyName)PropertygetPropertyDeclaration(java.lang.String propertyName)java.lang.StringgetPropertyPriority(java.lang.String propertyName)java.lang.StringgetPropertyValue(java.lang.String propertyName)inthashCode()java.lang.StringremoveProperty(java.lang.String propertyName)Remove a property.voidsetCssText(java.lang.String cssText)Sets the css text.voidsetCssText(java.lang.String cssText, CSSErrorHandler cssErrorHandler)Sets the css text.voidsetProperty(java.lang.String propertyName, java.lang.String value, java.lang.String priority)Set a property.java.lang.StringtoString()
-
-
-
Field Detail
-
PRIORITY_IMPORTANT
private static final java.lang.String PRIORITY_IMPORTANT
- See Also:
- Constant Field Values
-
parentRule_
private final AbstractCSSRuleImpl parentRule_
-
properties_
private final java.util.List<Property> properties_
-
-
Constructor Detail
-
CSSStyleDeclarationImpl
public CSSStyleDeclarationImpl(AbstractCSSRuleImpl parentRule)
Ctor.- Parameters:
parentRule- the parent role
-
-
Method Detail
-
getProperties
public java.util.List<Property> getProperties()
- Returns:
- the properties
-
getCssText
public java.lang.String getCssText()
- Returns:
- the current 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
-
setCssText
public void setCssText(java.lang.String cssText, CSSErrorHandler cssErrorHandler) throws org.w3c.dom.DOMExceptionSets the css text.- Parameters:
cssText- the new css textcssErrorHandler- the CSSErrorHandler to be used- Throws:
org.w3c.dom.DOMException- in case of error
-
getPropertyValue
public java.lang.String getPropertyValue(java.lang.String propertyName)
- Parameters:
propertyName- the property name- Returns:
- the property value
-
getPropertyCSSValue
public CSSValueImpl getPropertyCSSValue(java.lang.String propertyName)
- Parameters:
propertyName- the property name- Returns:
- the property value
-
removeProperty
public java.lang.String removeProperty(java.lang.String propertyName) throws org.w3c.dom.DOMExceptionRemove a property.- Parameters:
propertyName- the property name- Returns:
- the removed property
- Throws:
org.w3c.dom.DOMException- in case of error
-
getPropertyPriority
public java.lang.String getPropertyPriority(java.lang.String propertyName)
- Parameters:
propertyName- the name of the property- Returns:
- the priority
-
setProperty
public void setProperty(java.lang.String propertyName, java.lang.String value, java.lang.String priority) throws org.w3c.dom.DOMExceptionSet a property.- Parameters:
propertyName- the name of the propertyvalue- the new valuepriority- the priority- Throws:
org.w3c.dom.DOMException- in case of error
-
getLength
public int getLength()
- Returns:
- the properties count
-
getParentRule
public AbstractCSSRuleImpl getParentRule()
- Returns:
- the parent rule
-
addProperty
public void addProperty(Property p)
Add a property.- Parameters:
p- the property to add
-
getPropertyDeclaration
public Property getPropertyDeclaration(java.lang.String propertyName)
- Parameters:
propertyName- the name of the propery- Returns:
- the property
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
equalsProperties
private boolean equalsProperties(CSSStyleDeclarationImpl csd)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-