Package io.sf.carte.doc.style.css.om
Class AbstractCSSRule
java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSRule
- All Implemented Interfaces:
CSSRule
,Serializable
,org.w3c.dom.css.CSSRule
- Direct Known Subclasses:
BaseCSSDeclarationRule
,FontFeatureValuesRule
,GroupingRule
,ImportRule
,KeyframesRule
,NamespaceRule
,UnknownRule
Abstract class to be inherited by all CSS rules.
- See Also:
-
Field Summary
Fields inherited from interface io.sf.carte.doc.style.css.CSSRule
COUNTER_STYLE_RULE, CUSTOM_MEDIA_RULE, DOCUMENT_RULE, FONT_FACE_RULE, FONT_FEATURE_VALUES_RULE, IMPORT_RULE, KEYFRAME_RULE, KEYFRAMES_RULE, MARGIN_RULE, MEDIA_RULE, NAMESPACE_RULE, PAGE_RULE, PROPERTY_RULE, REGION_STYLE_RULE, STYLE_RULE, SUPPORTS_RULE, UNKNOWN_RULE, VIEWPORT_RULE
Fields inherited from interface org.w3c.dom.css.CSSRule
CHARSET_RULE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractCSSRule
clone
(AbstractCSSStyleSheet parentSheet) Obtain a clone of this rule whose parent sheet isparentSheet
.abstract void
If this rule does not contain a preceding comment list, create one.abstract void
If this rule does not contain a trailing comment list, create one.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.abstract short
getType()
void
setCssText
(String cssText) abstract void
setParentRule
(AbstractCSSRule parent) toString()
abstract void
writeCssText
(io.sf.carte.util.SimpleWriter wri, StyleFormattingContext context) Write a serialization of this rule to the given simple writer, according to the given context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.style.css.CSSRule
getPrecedingComments, getTrailingComments
-
Constructor Details
-
AbstractCSSRule
public AbstractCSSRule()
-
-
Method Details
-
getType
public abstract short getType()- Specified by:
getType
in interfaceorg.w3c.dom.css.CSSRule
-
getCssText
- Specified by:
getCssText
in interfaceorg.w3c.dom.css.CSSRule
-
setCssText
- Specified by:
setCssText
in interfaceorg.w3c.dom.css.CSSRule
- 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 interfaceCSSRule
- Returns:
- the minified textual representation of the rule.
-
toString
-
writeCssText
public abstract void writeCssText(io.sf.carte.util.SimpleWriter wri, StyleFormattingContext context) throws IOException Description copied from interface:CSSRule
Write a serialization of this rule to the given simple writer, according to the given context.- Specified by:
writeCssText
in interfaceCSSRule
- Parameters:
wri
- the simple writer object.context
- the formatting context.- Throws:
IOException
- if an error happened while writing.
-
getParentStyleSheet
Description copied from interface:CSSRule
Get the style sheet that contains this rule.- Specified by:
getParentStyleSheet
in interfaceCSSRule
- Specified by:
getParentStyleSheet
in interfaceorg.w3c.dom.css.CSSRule
- Returns:
- the style sheet, or null if no sheet contains this rule.
-
getParentRule
Description copied from interface:CSSRule
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 interfaceorg.w3c.dom.css.CSSRule
- 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()If this rule does not contain a preceding comment list, create one.If this rule already has a preceding comment list, does nothing.
-
enableTrailingComments
public abstract void enableTrailingComments()If this rule does not contain a trailing comment list, create one.If this rule already has a trailing comment list, does nothing.
-
clone
Obtain a clone of this rule whose parent sheet isparentSheet
.- Parameters:
parentSheet
- the parent sheet for the new rule.- Returns:
- a clone of this rule with the given parent sheet.
-