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.Serializable
Implementation of CSSStyleDeclaration.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractCSSRuleImpl
parentRule_
private static java.lang.String
PRIORITY_IMPORTANT
private 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 void
addProperty(Property p)
Add a property.boolean
equals(java.lang.Object obj)
private boolean
equalsProperties(CSSStyleDeclarationImpl csd)
java.lang.String
getCssText()
int
getLength()
AbstractCSSRuleImpl
getParentRule()
java.util.List<Property>
getProperties()
CSSValueImpl
getPropertyCSSValue(java.lang.String propertyName)
Property
getPropertyDeclaration(java.lang.String propertyName)
java.lang.String
getPropertyPriority(java.lang.String propertyName)
java.lang.String
getPropertyValue(java.lang.String propertyName)
int
hashCode()
java.lang.String
removeProperty(java.lang.String propertyName)
Remove a property.void
setCssText(java.lang.String cssText)
Sets the css text.void
setCssText(java.lang.String cssText, CSSErrorHandler cssErrorHandler)
Sets the css text.void
setProperty(java.lang.String propertyName, java.lang.String value, java.lang.String priority)
Set a property.java.lang.String
toString()
-
-
-
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.DOMException
Sets 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.DOMException
Sets 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.DOMException
Remove 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.DOMException
Set 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:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
equalsProperties
private boolean equalsProperties(CSSStyleDeclarationImpl csd)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-