Package org.htmlunit.cssparser.dom
Class CSSStyleDeclarationImpl
- java.lang.Object
-
- org.htmlunit.cssparser.dom.CSSStyleDeclarationImpl
-
- All Implemented Interfaces:
Serializable
public class CSSStyleDeclarationImpl extends Object implements Serializable
Implementation of CSSStyleDeclaration.- Author:
- Ronald Brill
- See Also:
- Serialized Form
-
-
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(Object obj)StringgetCssText()intgetLength()getLength.AbstractCSSRuleImplgetParentRule()getParentRule.List<Property>getProperties()getProperties.CSSValueImplgetPropertyCSSValue(String propertyName)getPropertyCSSValue.PropertygetPropertyDeclaration(String propertyName)getPropertyDeclaration.StringgetPropertyPriority(String propertyName)getPropertyPriority.StringgetPropertyValue(String propertyName)inthashCode()StringremoveProperty(String propertyName)Remove a property.voidsetCssText(String cssText)Sets the css text.voidsetCssText(String cssText, CSSErrorHandler cssErrorHandler)Sets the css text.voidsetProperty(String propertyName, String value, String priority)Set a property.StringtoString()
-
-
-
Constructor Detail
-
CSSStyleDeclarationImpl
public CSSStyleDeclarationImpl(AbstractCSSRuleImpl parentRule)
Ctor.- Parameters:
parentRule- the parent role
-
-
Method Detail
-
getCssText
public String getCssText()
- Returns:
- the current 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
-
setCssText
public void setCssText(String cssText, CSSErrorHandler cssErrorHandler) throws DOMException
Sets the css text.- Parameters:
cssText- the new css textcssErrorHandler- the CSSErrorHandler to be used- Throws:
DOMException- in case of error
-
getPropertyValue
public String getPropertyValue(String propertyName)
- Parameters:
propertyName- the property name- Returns:
- the property value
-
getPropertyCSSValue
public CSSValueImpl getPropertyCSSValue(String propertyName)
getPropertyCSSValue.
- Parameters:
propertyName- the property name- Returns:
- the property value
-
removeProperty
public String removeProperty(String propertyName) throws DOMException
Remove a property.- Parameters:
propertyName- the property name- Returns:
- the removed property
- Throws:
DOMException- in case of error
-
getPropertyPriority
public String getPropertyPriority(String propertyName)
getPropertyPriority.
- Parameters:
propertyName- the name of the property- Returns:
- the priority
-
setProperty
public void setProperty(String propertyName, String value, String priority) throws DOMException
Set a property.- Parameters:
propertyName- the name of the propertyvalue- the new valuepriority- the priority- Throws:
DOMException- in case of error
-
getLength
public int getLength()
getLength.
- Returns:
- the properties count
-
getParentRule
public AbstractCSSRuleImpl getParentRule()
getParentRule.
- Returns:
- the parent rule
-
addProperty
public void addProperty(Property p)
Add a property.- Parameters:
p- the property to add
-
getPropertyDeclaration
public Property getPropertyDeclaration(String propertyName)
getPropertyDeclaration.
- Parameters:
propertyName- the name of the propery- Returns:
- the property
-
-