Package org.htmlunit.cssparser.dom
Class CSSMediaRuleImpl
- java.lang.Object
-
- org.htmlunit.cssparser.parser.AbstractLocatable
-
- org.htmlunit.cssparser.dom.AbstractCSSRuleImpl
-
- org.htmlunit.cssparser.dom.CSSMediaRuleImpl
-
- All Implemented Interfaces:
java.io.Serializable
,Locatable
public class CSSMediaRuleImpl extends AbstractCSSRuleImpl
Implementation of CSSMediaRule.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private CSSRuleListImpl
cssRules_
private MediaListImpl
mediaList_
-
Constructor Summary
Constructors Constructor Description CSSMediaRuleImpl(CSSStyleSheetImpl parentStyleSheet, AbstractCSSRuleImpl parentRule, MediaListImpl media)
Ctor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteRule(int index)
Removes a rule at the given index.boolean
equals(java.lang.Object obj)
CSSRuleListImpl
getCssRules()
java.lang.String
getCssText()
MediaListImpl
getMediaList()
int
hashCode()
void
insertRule(java.lang.String rule, int index)
Insert a new rule at the given index.private void
readObject(java.io.ObjectInputStream in)
void
setCssText(java.lang.String cssText)
Sets the css text.void
setRuleList(CSSRuleListImpl rules)
Replaces the rule list.java.lang.String
toString()
private void
writeObject(java.io.ObjectOutputStream out)
-
Methods inherited from class org.htmlunit.cssparser.dom.AbstractCSSRuleImpl
getParentRule, getParentStyleSheet, setParentRule, setParentStyleSheet
-
Methods inherited from class org.htmlunit.cssparser.parser.AbstractLocatable
getLocator, setLocator
-
-
-
-
Field Detail
-
mediaList_
private MediaListImpl mediaList_
-
cssRules_
private CSSRuleListImpl cssRules_
-
-
Constructor Detail
-
CSSMediaRuleImpl
public CSSMediaRuleImpl(CSSStyleSheetImpl parentStyleSheet, AbstractCSSRuleImpl parentRule, MediaListImpl media)
Ctor.- Parameters:
parentStyleSheet
- the parent style sheetparentRule
- the parent rulemedia
- the media
-
-
Method Detail
-
getCssText
public java.lang.String getCssText()
- Specified by:
getCssText
in classAbstractCSSRuleImpl
- Returns:
- the current css text
-
setCssText
public void setCssText(java.lang.String cssText) throws org.w3c.dom.DOMException
Sets the css text.- Specified by:
setCssText
in classAbstractCSSRuleImpl
- Parameters:
cssText
- the new css text- Throws:
org.w3c.dom.DOMException
-
getMediaList
public MediaListImpl getMediaList()
- Returns:
- the media list
-
getCssRules
public CSSRuleListImpl getCssRules()
- Returns:
- the css rules
-
insertRule
public void insertRule(java.lang.String rule, int index) throws org.w3c.dom.DOMException
Insert a new rule at the given index.- Parameters:
rule
- the rule to be insertedindex
- the insert pos- Throws:
org.w3c.dom.DOMException
- in case of error
-
deleteRule
public void deleteRule(int index) throws org.w3c.dom.DOMException
Removes a rule at the given index.- Parameters:
index
- the insert pos- Throws:
org.w3c.dom.DOMException
- in case of error
-
setRuleList
public void setRuleList(CSSRuleListImpl rules)
Replaces the rule list.- Parameters:
rules
- the new rule list
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classAbstractCSSRuleImpl
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractCSSRuleImpl
-
writeObject
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
- Throws:
java.io.IOException
-
readObject
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-