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_RULE
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractCSSRule
clone
(AbstractCSSStyleSheet parentSheet) Obtain a clone of this rule whose parent sheet isparentSheet
.abstract void
enablePrecedingComments
(int initialSize) If this rule does not contain a preceding comment list, create one with the given initial capacity.abstract String
abstract String
A minified parsable textual representation of the rule.abstract byte
Get the origin of this rule (user agent sheet, author, user).abstract AbstractCSSRule
If this rule is contained inside another rule, return that rule.abstract AbstractCSSStyleSheet
Get the style sheet that contains this rule.Get a list of the comments that preceded this rule, if any.abstract short
getType()
void
setCssText
(String cssText) abstract void
setParentRule
(AbstractCSSRule parent) toString()
abstract void
writeCssText
(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:
getCssText
in interfaceCSSRule
-
setCssText
- Specified by:
setCssText
in 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:
getMinifiedCssText
in 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:ExtendedCSSRule
Write a serialization of this rule to the given simple writer, according to the given context.- Specified by:
writeCssText
in interfaceExtendedCSSRule
- Parameters:
wri
- the simple writer object.context
- the formatting context.- Throws:
IOException
- if an error happened while writing.
-
getParentStyleSheet
Description copied from interface:ExtendedCSSRule
Get the style sheet that contains this rule.- Specified by:
getParentStyleSheet
in interfaceCSSRule
- Specified by:
getParentStyleSheet
in interfaceExtendedCSSRule
- Returns:
- the style sheet, or null if no sheet contains this rule.
-
getParentRule
Description copied from interface:ExtendedCSSRule
If this rule is contained inside another rule, return that rule. If it is not nested inside any other rules, returnnull
.- Specified by:
getParentRule
in interfaceCSSRule
- Specified by:
getParentRule
in 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
null
if 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:
clone
in interfaceExtendedCSSRule
- Parameters:
parentSheet
- the parent sheet for the new rule.- Returns:
- a clone of this rule with the given parent sheet.
-