@NotThreadSafe public class CascadingStyleSheet extends AbstractHasTopLevelRules implements ICSSSourceLocationAware
ICSSTopLevelRule) are maintained in a combined list.m_aRules| Constructor and Description |
|---|
CascadingStyleSheet() |
| Modifier and Type | Method and Description |
|---|---|
CascadingStyleSheet |
addImportRule(CSSImportRule aImportRule)
Add a new
@import rule at the end of the @import
rule list. |
CascadingStyleSheet |
addImportRule(int nIndex,
CSSImportRule aImportRule)
Add a new
@import rule at a specified index of the
@import rule list. |
CascadingStyleSheet |
addNamespaceRule(CSSNamespaceRule aNamespaceRule)
Add a new
@namespace rule at the end of the
@namespace rule list. |
CascadingStyleSheet |
addNamespaceRule(int nIndex,
CSSNamespaceRule aNamespaceRule)
Add a new
@namespace rule at the specified index of the
@namespace rule list. |
boolean |
equals(Object o) |
com.helger.commons.collection.impl.ICommonsList<CSSImportRule> |
getAllImportRules() |
com.helger.commons.collection.impl.ICommonsList<CSSNamespaceRule> |
getAllNamespaceRules() |
CSSImportRule |
getImportRuleAtIndex(int nIndex)
Get the
@import rule at the specified index. |
int |
getImportRuleCount() |
CSSNamespaceRule |
getNamespaceRuleAtIndex(int nIndex)
Get the
@namespace rule at the specified index. |
int |
getNamespaceRuleCount() |
CSSSourceLocation |
getSourceLocation() |
int |
hashCode() |
boolean |
hasImportRules() |
boolean |
hasNamespaceRules() |
com.helger.commons.state.EChange |
removeAllImportRules()
Remove all
@import rules. |
com.helger.commons.state.EChange |
removeAllNamespaceRules()
Remove all
@namespace rules. |
com.helger.commons.state.EChange |
removeImportRule(CSSImportRule aImportRule)
Remove the specified
@import rule. |
com.helger.commons.state.EChange |
removeImportRule(int nImportRuleIndex)
Remove the
@import rule at the specified index. |
com.helger.commons.state.EChange |
removeNamespaceRule(CSSNamespaceRule aNamespaceRule)
Remove the specified
@namespace rule. |
com.helger.commons.state.EChange |
removeNamespaceRule(int nNamespaceRuleIndex)
Remove the
@namespace rule at the specified index. |
void |
setSourceLocation(CSSSourceLocation aSourceLocation)
Set the source location of the object, determined while parsing.
|
String |
toString() |
addRule, addRule, getAllFontFaceRules, getAllKeyframesRules, getAllMediaRules, getAllPageRules, getAllRules, getAllRules, getAllStyleRules, getAllSupportsRules, getAllUnknownRules, getAllViewportRules, getFontFaceRuleAtIndex, getFontFaceRuleCount, getKeyframesRuleAtIndex, getKeyframesRuleCount, getMediaRuleAtIndex, getMediaRuleCount, getPageRuleAtIndex, getPageRuleCount, getRule, getRuleAtIndex, getRuleCount, getStyleRuleAtIndex, getStyleRuleCount, getSupportsRuleAtIndex, getSupportsRuleCount, getUnknownRuleAtIndex, getUnknownRuleCount, getViewportRuleAtIndex, getViewportRuleCount, hasFontFaceRules, hasKeyframesRules, hasMediaRules, hasPageRules, hasRules, hasStyleRules, hasSupportsRules, hasUnknownRules, hasViewportRules, removeAllRules, removeRule, removeRule, removeRulespublic boolean hasImportRules()
true if at least one @import rule is
present, false otherwise.@Nonnegative public int getImportRuleCount()
@import rules. Always ≥ 0.@Nullable public CSSImportRule getImportRuleAtIndex(@Nonnegative int nIndex)
@import rule at the specified index.nIndex - The index to be resolved. Should be ≥ 0 and <
getImportRuleCount().null if an invalid index was specified.@Nonnull public CascadingStyleSheet addImportRule(@Nonnull CSSImportRule aImportRule)
@import rule at the end of the @import
rule list.aImportRule - The import rule to add. May not be null.@Nonnull public CascadingStyleSheet addImportRule(@Nonnegative int nIndex, @Nonnull CSSImportRule aImportRule)
@import rule at a specified index of the
@import rule list.nIndex - The index where the rule should be added. Must be ≥ 0.aImportRule - The import rule to add. May not be null.ArrayIndexOutOfBoundsException - if the index is invalid@Nonnull public com.helger.commons.state.EChange removeImportRule(@Nullable CSSImportRule aImportRule)
@import rule.aImportRule - The import rule to be removed. May be null.EChange.CHANGED if removal was successful,
EChange.UNCHANGED otherwise. Never null.@Nonnull public com.helger.commons.state.EChange removeImportRule(@Nonnegative int nImportRuleIndex)
@import rule at the specified index.nImportRuleIndex - The index to be removed. Should be ≥ 0.EChange.CHANGED if removal was successful,
EChange.UNCHANGED otherwise. Never null.@Nonnull public com.helger.commons.state.EChange removeAllImportRules()
@import rules.EChange.CHANGED if any rule was removed,
EChange.UNCHANGED otherwise. Never null.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<CSSImportRule> getAllImportRules()
@import rules. Never
null.public boolean hasNamespaceRules()
true if at least one @namespace rule is
present, false otherwise.@Nonnegative public int getNamespaceRuleCount()
@namespace rules. Always ≥
0.@Nullable public CSSNamespaceRule getNamespaceRuleAtIndex(@Nonnegative int nIndex)
@namespace rule at the specified index.nIndex - The index to be resolved. Should be ≥ 0 and <
getNamespaceRuleCount().null if an invalid index was specified.@Nonnull public CascadingStyleSheet addNamespaceRule(@Nonnull CSSNamespaceRule aNamespaceRule)
@namespace rule at the end of the
@namespace rule list.aNamespaceRule - The namespace rule to be added. May not be null.@Nonnull public CascadingStyleSheet addNamespaceRule(@Nonnegative int nIndex, @Nonnull CSSNamespaceRule aNamespaceRule)
@namespace rule at the specified index of the
@namespace rule list.nIndex - The index where the rule should be added. Must be ≥ 0.aNamespaceRule - The namespace rule to be added. May not be null.@Nonnull public com.helger.commons.state.EChange removeNamespaceRule(@Nullable CSSNamespaceRule aNamespaceRule)
@namespace rule.aNamespaceRule - The namespace rule to be removed. May be null.EChange.CHANGED if the namespace rule was successfully
removed, EChange.UNCHANGED otherwise. Never
null.@Nonnull public com.helger.commons.state.EChange removeNamespaceRule(@Nonnegative int nNamespaceRuleIndex)
@namespace rule at the specified index.nNamespaceRuleIndex - The index to be removed. Should be ≥ 0.EChange.CHANGED if the namespace rule was successfully
removed, EChange.UNCHANGED otherwise. Never
null.@Nonnull public com.helger.commons.state.EChange removeAllNamespaceRules()
@namespace rules.EChange.CHANGED if any rule was removed,
EChange.UNCHANGED otherwise. Never null.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<CSSNamespaceRule> getAllNamespaceRules()
@namespace rules. Never
null.@Nullable public final CSSSourceLocation getSourceLocation()
getSourceLocation in interface ICSSSourceLocationAwarenull if an object was not read but manually
created.public final void setSourceLocation(@Nullable CSSSourceLocation aSourceLocation)
ICSSSourceLocationAwaresetSourceLocation in interface ICSSSourceLocationAwareaSourceLocation - The source location to use. May be null.Copyright © 2014–2022 Philip Helger. All rights reserved.