java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSRule
io.sf.carte.doc.style.css.om.ImportRule
- All Implemented Interfaces:
CSSImportRule,CSSRule,Serializable,CSSImportRule,CSSRule
Implementation of CSSImportRule.
- 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, NESTED_DECLARATIONS, PAGE_RULE, PROPERTY_RULE, REGION_STYLE_RULE, STYLE_RULE, SUPPORTS_RULE, UNKNOWN_RULE, VIEWPORT_RULEFields inherited from interface org.w3c.dom.css.CSSRule
CHARSET_RULE, FONT_FACE_RULE, IMPORT_RULE, MEDIA_RULE, PAGE_RULE, STYLE_RULE, UNKNOWN_RULE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedImportRule(AbstractCSSStyleSheet parentSheet, String layerName, BooleanCondition supportsCondition, MediaQueryList mediaList, String href, int origin) Construct an import rule with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionclone(AbstractCSSStyleSheet parentSheet) Obtain a clone of this rule whose parent sheet isparentSheet.protected ParservoidIf this rule does not contain a preceding comment list, create one.voidIf this rule does not contain a trailing comment list, create one.booleangetHref()The layer name declared in the at-rule itself, or an empty string if the layer is anonymous, ornullif the at-rule does not declare a layer.getMedia()A minified parsable textual representation of the rule.intGet the origin of this rule (user agent sheet, author, user).If this rule is contained inside another rule, return that rule.Get the style sheet that contains this rule.Get a list of the comments that preceded this rule, if any.protected StyleFormattingContextThe<supports-condition>declared in the at-rule, ornullif the at-rule does not declare a supports condition.Get a list of the comments that immediately follow this rule, if any.shortgetType()protected URLGets an URL for the given URI, taking into account the parent CSS Base URL if appropriate.inthashCode()voidsetParentRule(AbstractCSSRule parent) Sets the parent CSS rule, in case this rule is contained by another.voidwriteCssText(SimpleWriter wri, StyleFormattingContext context) Write a serialization of this rule to the given simple writer, according to the given context.Methods inherited from class io.sf.carte.doc.style.css.om.AbstractCSSRule
clone, setCssText, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.sf.carte.doc.style.css.CSSRule
getParentRule, getParentStyleSheet, getPrecedingComments, getTrailingComments, setCssText
-
Constructor Details
-
ImportRule
protected ImportRule(AbstractCSSStyleSheet parentSheet, String layerName, BooleanCondition supportsCondition, MediaQueryList mediaList, String href, int origin) Construct an import rule with the given parameters.- Parameters:
parentSheet- the parent style sheet.layerName- the layer name declared in the at-rule itself, or an empty string if the layer is anonymous, ornullif the at-rule does not declare a layer.supportsCondition- the supports condition, ornullif none.mediaList- the media list to which the sheet shall apply.href- the URI from which to import the sheet.origin- the origin of the rule.
-
-
Method Details
-
getHref
- Specified by:
getHrefin interfaceCSSImportRule
-
getLayerName
Description copied from interface:CSSImportRuleThe layer name declared in the at-rule itself, or an empty string if the layer is anonymous, ornullif the at-rule does not declare a layer.- Specified by:
getLayerNamein interfaceCSSImportRule- Returns:
- the layer name.
-
getSupportsCondition
Description copied from interface:CSSImportRuleThe<supports-condition>declared in the at-rule, ornullif the at-rule does not declare a supports condition.- Specified by:
getSupportsConditionin interfaceCSSImportRule- Returns:
- the supports condition.
-
getMedia
- Specified by:
getMediain interfaceCSSImportRule
-
getStyleSheet
- Specified by:
getStyleSheetin interfaceCSSImportRule
-
getCssText
- Specified by:
getCssTextin interfaceCSSRule- Specified by:
getCssTextin classAbstractCSSRule
-
writeCssText
Description copied from interface:CSSRuleWrite a serialization of this rule to the given simple writer, according to the given context.- Specified by:
writeCssTextin interfaceCSSRule- Specified by:
writeCssTextin classAbstractCSSRule- Parameters:
wri- the simple writer object.context- the formatting context.- Throws:
IOException- if an error happened while writing.
-
getMinifiedCssText
Description copied from class:AbstractCSSRuleA minified parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.- Specified by:
getMinifiedCssTextin interfaceCSSRule- Returns:
- the minified textual representation of the rule.
-
hashCode
public int hashCode() -
equals
-
clone
Description copied from class:AbstractCSSRuleObtain a clone of this rule whose parent sheet isparentSheet.- Specified by:
clonein classAbstractCSSRule- Parameters:
parentSheet- the parent sheet for the new rule.- Returns:
- a clone of this rule with the given parent sheet.
-
getType
public short getType()- Specified by:
getTypein interfaceCSSRule- Specified by:
getTypein classAbstractCSSRule
-
getParentStyleSheet
Description copied from interface:CSSRuleGet the style sheet that contains this rule.- Specified by:
getParentStyleSheetin interfaceCSSRule- Specified by:
getParentStyleSheetin interfaceCSSRule- Specified by:
getParentStyleSheetin classAbstractCSSRule- Returns:
- the style sheet, or null if no sheet contains this rule.
-
createSACParser
- Throws:
DOMException
-
getParentRule
Description copied from interface:CSSRuleIf 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 interfaceCSSRule- Specified by:
getParentRulein classAbstractCSSRule- Returns:
- the containing rule, if any, otherwise
null.
-
setParentRule
Sets the parent CSS rule, in case this rule is contained by another.- Specified by:
setParentRulein classAbstractCSSRule- Parameters:
parent- the parent rule.
-
getOrigin
public int getOrigin()Description copied from class:AbstractCSSRuleGet the origin of this rule (user agent sheet, author, user).- Specified by:
getOriginin classAbstractCSSRule- Returns:
- the origin of this rule.
-
enablePrecedingComments
public void enablePrecedingComments()Description copied from class:AbstractCSSRuleIf this rule does not contain a preceding comment list, create one.If this rule already has a preceding comment list, does nothing.
- Specified by:
enablePrecedingCommentsin classAbstractCSSRule
-
getPrecedingComments
Description copied from interface:CSSRuleGet 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:
-
enableTrailingComments
public void enableTrailingComments()Description copied from class:AbstractCSSRuleIf this rule does not contain a trailing comment list, create one.If this rule already has a trailing comment list, does nothing.
- Specified by:
enableTrailingCommentsin classAbstractCSSRule
-
getTrailingComments
Description copied from interface:CSSRuleGet a list of the comments that immediately follow this rule, if any.If the parsing mode was
COMMENTS_PRECEDING, or wasCOMMENTS_AUTOand the next comment happens after a newline character, it shall be assigned to the next rule as a preceding comment.- Returns:
- the list of comments, or
nullif there were no trailing comments or the parsing was specified to ignore comments. - See Also:
-
getStyleFormattingContext
-
getURL
Gets an URL for the given URI, taking into account the parent CSS Base URL if appropriate.- Parameters:
uri- the uri.- Returns:
- the absolute URL.
- Throws:
MalformedURLException- if the URL could not be built.
-