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:
Serializable,Locatable
public class CSSMediaRuleImpl extends AbstractCSSRuleImpl
Implementation of CSSMediaRule.- Author:
- Ronald Brill
- See Also:
- Serialized Form
-
-
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 voiddeleteRule(int index)Removes a rule at the given index.booleanequals(Object obj)CSSRuleListImplgetCssRules()getCssRules.StringgetCssText()getCssText.MediaListImplgetMediaList()getMediaList.inthashCode()voidinsertRule(String rule, int index)Insert a new rule at the given index.voidsetCssText(String cssText)Sets the css text.voidsetRuleList(CSSRuleListImpl rules)Replaces the rule list.StringtoString()-
Methods inherited from class org.htmlunit.cssparser.dom.AbstractCSSRuleImpl
getParentRule, getParentStyleSheet, setParentRule, setParentStyleSheet
-
Methods inherited from class org.htmlunit.cssparser.parser.AbstractLocatable
getLocator, setLocator
-
-
-
-
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 String getCssText()
getCssText.
- Specified by:
getCssTextin classAbstractCSSRuleImpl- Returns:
- the current css text
-
setCssText
public void setCssText(String cssText) throws DOMException
Sets the css text.- Specified by:
setCssTextin classAbstractCSSRuleImpl- Parameters:
cssText- the new css text- Throws:
DOMException
-
getMediaList
public MediaListImpl getMediaList()
getMediaList.
- Returns:
- the media list
-
getCssRules
public CSSRuleListImpl getCssRules()
getCssRules.
- Returns:
- the css rules
-
insertRule
public void insertRule(String rule, int index) throws DOMException
Insert a new rule at the given index.- Parameters:
rule- the rule to be insertedindex- the insert pos- Throws:
DOMException- in case of error
-
deleteRule
public void deleteRule(int index) throws DOMExceptionRemoves a rule at the given index.- Parameters:
index- the insert pos- Throws:
DOMException- in case of error
-
setRuleList
public void setRuleList(CSSRuleListImpl rules)
Replaces the rule list.- Parameters:
rules- the new rule list
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classAbstractCSSRuleImpl
-
hashCode
public int hashCode()
Description copied from class:AbstractCSSRuleImpl- Overrides:
hashCodein classAbstractCSSRuleImpl
-
-