java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSRule
- All Implemented Interfaces:
ExtendedCSSRule,CSSRule
- Direct Known Subclasses:
BaseCSSDeclarationRule,FontFeatureValuesRule,GroupingRule,ImportRule,KeyframesRule,NamespaceRule,UnknownRule
Abstract class to be inherited by all CSS rules.
-
Field Summary
Fields inherited from interface org.w3c.dom.css.CSSRule
CHARSET_RULE, FONT_FACE_RULE, IMPORT_RULE, MEDIA_RULE, PAGE_RULE, STYLE_RULE, UNKNOWN_RULEFields inherited from interface io.sf.carte.doc.style.css.ExtendedCSSRule
COUNTER_STYLE_RULE, CUSTOM_MEDIA_RULE, DOCUMENT_RULE, FONT_FEATURE_VALUES_RULE, KEYFRAME_RULE, KEYFRAMES_RULE, MARGIN_RULE, NAMESPACE_RULE, REGION_STYLE_RULE, SUPPORTS_RULE, VIEWPORT_RULE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractCSSRuleclone(AbstractCSSStyleSheet parentSheet) Obtain a clone of this rule whose parent sheet isparentSheet.abstract voidenablePrecedingComments(int initialSize) If this rule does not contain a preceding comment list, create one with the given initial capacity.abstract Stringabstract StringA minified parsable textual representation of the rule.abstract byteGet the origin of this rule (user agent sheet, author, user).abstract AbstractCSSRuleIf this rule is contained inside another rule, return that rule.abstract AbstractCSSStyleSheetGet the style sheet that contains this rule.Get a list of the comments that preceded this rule, if any.abstract shortgetType()voidsetCssText(String cssText) abstract voidsetParentRule(AbstractCSSRule parent) toString()abstract voidwriteCssText(SimpleWriter wri, StyleFormattingContext context) Write a serialization of this rule to the given simple writer, according to the given context.
-
Constructor Details
-
AbstractCSSRule
public AbstractCSSRule()
-
-
Method Details
-
getType
public abstract short getType() -
getCssText
- Specified by:
getCssTextin interfaceCSSRule
-
setCssText
- Specified by:
setCssTextin interfaceCSSRule- Throws:
DOMException
-
getMinifiedCssText
A minified parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.- Specified by:
getMinifiedCssTextin interfaceExtendedCSSRule- Returns:
- the minified textual representation of the rule.
-
toString
-
writeCssText
public abstract void writeCssText(SimpleWriter wri, StyleFormattingContext context) throws IOException Description copied from interface:ExtendedCSSRuleWrite a serialization of this rule to the given simple writer, according to the given context.- Specified by:
writeCssTextin interfaceExtendedCSSRule- Parameters:
wri- the simple writer object.context- the formatting context.- Throws:
IOException- if an error happened while writing.
-
getParentStyleSheet
Description copied from interface:ExtendedCSSRuleGet the style sheet that contains this rule.- Specified by:
getParentStyleSheetin interfaceCSSRule- Specified by:
getParentStyleSheetin interfaceExtendedCSSRule- Returns:
- the style sheet, or null if no sheet contains this rule.
-
getParentRule
Description copied from interface:ExtendedCSSRuleIf this rule is contained inside another rule, return that rule. If it is not nested inside any other rules, returnnull.- Specified by:
getParentRulein interfaceCSSRule- Specified by:
getParentRulein interfaceExtendedCSSRule- Returns:
- the containing rule, if any, otherwise
null.
-
setParentRule
-
getOrigin
public abstract byte getOrigin()Get the origin of this rule (user agent sheet, author, user).- Returns:
- the origin of this rule.
-
enablePrecedingComments
public abstract void enablePrecedingComments(int initialSize) If this rule does not contain a preceding comment list, create one with the given initial capacity.If this rule already has a comment list, does nothing.
- Parameters:
initialSize- the initial capacity.
-
getPrecedingComments
Get a list of the comments that preceded this rule, if any.- Returns:
- the list of comments, or
nullif there were no preceding comments or the parsing was specified to ignore comments. - See Also:
-
clone
Obtain a clone of this rule whose parent sheet isparentSheet.- Specified by:
clonein interfaceExtendedCSSRule- Parameters:
parentSheet- the parent sheet for the new rule.- Returns:
- a clone of this rule with the given parent sheet.
-