@NotThreadSafe public class CSSSupportsRule extends Object implements ICSSTopLevelRule, ICSSSourceLocationAware, ICSSVersionAware
@supports/code> rule: a list of style rules only
valid when a certain declaration is available. See ECSSSpecification.CSS3_CONDITIONAL
Example:
@supports (transition-property: color) {
div { color:red; }
}
Constructor and Description |
---|
CSSSupportsRule() |
public boolean hasSupportConditionMembers()
@Nonnegative public int getSupportsConditionMemberCount()
@Nonnull public CSSSupportsRule addSupportConditionMember(@Nonnull ICSSSupportsConditionMember aMember)
@Nonnull public CSSSupportsRule addSupportConditionMember(@Nonnegative int nIndex, @Nonnull ICSSSupportsConditionMember aMember)
@Nonnull public com.helger.commons.state.EChange removeSupportsConditionMember(@Nonnull ICSSSupportsConditionMember aMember)
@Nonnull public com.helger.commons.state.EChange removeSupportsConditionMember(@Nonnegative int nIndex)
@Nonnull public com.helger.commons.state.EChange removeAllSupportsConditionMembers()
EChange.CHANGED
if any supports condition was removed,
EChange.UNCHANGED
otherwise. Never null
.@Nullable public ICSSSupportsConditionMember getSupportsConditionMemberAtIndex(@Nonnegative int nIndex)
@Nonnull @ReturnsMutableCopy public List<ICSSSupportsConditionMember> getAllSupportConditionMembers()
public boolean hasRules()
@Nonnegative public int getRuleCount()
@Nonnull public CSSSupportsRule addRule(@Nonnull ICSSTopLevelRule aRule)
@Nonnull public CSSSupportsRule addRule(@Nonnegative int nIndex, @Nonnull ICSSTopLevelRule aRule)
@Nonnull public com.helger.commons.state.EChange removeRule(@Nonnull ICSSTopLevelRule aRule)
@Nonnull public com.helger.commons.state.EChange removeRule(@Nonnegative int nRuleIndex)
@Nullable public ICSSTopLevelRule getRule(@Nonnegative int nRuleIndex)
@Nonnull public com.helger.commons.state.EChange removeAllDeclarations()
EChange.CHANGED
if any rule was removed,
EChange.UNCHANGED
otherwise. Never null
.@Nonnull @ReturnsMutableCopy public List<ICSSTopLevelRule> getAllRules()
@Nonnull @Nonempty public String getAsCSSString(@Nonnull ICSSWriterSettings aSettings, @Nonnegative int nIndentLevel)
ICSSWriteable
getAsCSSString
in interface ICSSWriteable
aSettings
- The settings to be used to format the output. May not be
null
.nIndentLevel
- The current indentation level@Nonnull public ECSSVersion getMinimumCSSVersion()
getMinimumCSSVersion
in interface ICSSVersionAware
null
.public void setSourceLocation(@Nullable CSSSourceLocation aSourceLocation)
ICSSSourceLocationAware
setSourceLocation
in interface ICSSSourceLocationAware
aSourceLocation
- The source location to use. May be null
.@Nullable public CSSSourceLocation getSourceLocation()
getSourceLocation
in interface ICSSSourceLocationAware
null
if an object was not read but manually
created.Copyright © 2014–2015 Philip Helger. All rights reserved.