com.steadystate.css.dom
public class CSSStyleDeclarationImpl extends java.lang.Object implements CSSStyleDeclaration, java.io.Serializable
| Constructor and Description |
|---|
CSSStyleDeclarationImpl(CSSRule parentRule) |
| Modifier and Type | Method and Description |
|---|---|
void |
addProperty(Property p) |
java.lang.String |
getCssText()
The parsable textual representation of the declaration block
(excluding the surrounding curly braces).
|
int |
getLength()
The number of properties that have been explicitly set in this
declaration block.
|
CSSRule |
getParentRule()
The CSS rule that contains this declaration block or
null
if this CSSStyleDeclaration is not attached to a
CSSRule. |
CSSValue |
getPropertyCSSValue(java.lang.String propertyName)
Used to retrieve the object representation of the value of a CSS
property if it has been explicitly set within this declaration block.
|
java.lang.String |
getPropertyPriority(java.lang.String propertyName)
Used to retrieve the priority of a CSS property (e.g.
|
java.lang.String |
getPropertyValue(java.lang.String propertyName)
Used to retrieve the value of a CSS property if it has been explicitly
set within this declaration block.
|
java.lang.String |
item(int index)
Used to retrieve the properties that have been explicitly set in this
declaration block.
|
java.lang.String |
removeProperty(java.lang.String propertyName)
Used to remove a CSS property if it has been explicitly set within
this declaration block.
|
void |
setCssText(java.lang.String cssText) |
void |
setProperty(java.lang.String propertyName,
java.lang.String value,
java.lang.String priority)
Used to set a property value and priority within this declaration
block.
|
java.lang.String |
toString() |
public CSSStyleDeclarationImpl(CSSRule parentRule)
public java.lang.String getCssText()
CSSStyleDeclarationgetCssText in interface CSSStyleDeclarationpublic void setCssText(java.lang.String cssText)
throws org.w3c.dom.DOMException
setCssText in interface CSSStyleDeclarationorg.w3c.dom.DOMExceptionpublic java.lang.String getPropertyValue(java.lang.String propertyName)
CSSStyleDeclarationgetPropertyValue in interface CSSStyleDeclarationpropertyName - The name of the CSS property. See the CSS property
index.public CSSValue getPropertyCSSValue(java.lang.String propertyName)
CSSStyleDeclarationnull if the property is a shorthand
property. Shorthand property values can only be accessed and modified
as strings, using the getPropertyValue and
setProperty methods.getPropertyCSSValue in interface CSSStyleDeclarationpropertyName - The name of the CSS property. See the CSS property
index.null if the
property has not been set.public java.lang.String removeProperty(java.lang.String propertyName)
throws org.w3c.dom.DOMException
CSSStyleDeclarationremoveProperty in interface CSSStyleDeclarationpropertyName - The name of the CSS property. See the CSS property
index.org.w3c.dom.DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is readonly
or the property is readonly.public java.lang.String getPropertyPriority(java.lang.String propertyName)
CSSStyleDeclaration"important" qualifier) if the property has been
explicitly set in this declaration block.getPropertyPriority in interface CSSStyleDeclarationpropertyName - The name of the CSS property. See the CSS property
index."important") if one exists. The empty string if none
exists.public void setProperty(java.lang.String propertyName,
java.lang.String value,
java.lang.String priority)
throws org.w3c.dom.DOMException
CSSStyleDeclarationsetProperty in interface CSSStyleDeclarationpropertyName - The name of the CSS property. See the CSS property
index.value - The new value of the property.priority - The new priority of the property (e.g.
"important").org.w3c.dom.DOMException - SYNTAX_ERR: Raised if the specified value has a syntax error and is
unparsable.
public int getLength()
CSSStyleDeclarationgetLength in interface CSSStyleDeclarationpublic java.lang.String item(int index)
CSSStyleDeclarationitem in interface CSSStyleDeclarationindex - Index of the property name to retrieve.public CSSRule getParentRule()
CSSStyleDeclarationnull
if this CSSStyleDeclaration is not attached to a
CSSRule.getParentRule in interface CSSStyleDeclarationpublic void addProperty(Property p)
public java.lang.String toString()
toString in class java.lang.Object