java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSStyleSheetFactory
- All Implemented Interfaces:
CSSStyleSheetFactory
,Serializable
- Direct Known Subclasses:
BaseCSSStyleSheetFactory
public abstract class AbstractCSSStyleSheetFactory
extends Object
implements CSSStyleSheetFactory, Serializable
Abstract class for CSS style sheet factories.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
Deprecated, for removal: This API element is subject to removal in a future version.static final byte
Deprecated, for removal: This API element is subject to removal in a future version.Fields inherited from interface io.sf.carte.doc.style.css.CSSStyleSheetFactory
FLAG_STRING_DOUBLE_QUOTE, FLAG_STRING_SINGLE_QUOTE, ORIGIN_AUTHOR, ORIGIN_USER, ORIGIN_USER_AGENT, ORIGIN_USER_IMPORTANT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractCSSStyleDeclaration
Create a style declaration for an anonymous inline box, associated to a text/cdata node.protected abstract InlineStyle
createInlineStyle
(Node owner) Create an inline style.protected abstract AbstractCSSStyleSheet
createLinkedStyleSheet
(Node ownerNode, String title, MediaQueryList mediaList) Creates an author (document-linked) CSS style sheet.protected abstract AbstractCSSStyleSheet
createRuleStyleSheet
(AbstractCSSRule ownerRule, String title, MediaQueryList mediaList) Creates a CSS style sheet owned by a CSS rule.protected abstract Parser
Create a NSAC Parser with the proper flags enabled.abstract AbstractCSSStyleSheet
createStyleSheet
(String title, MediaQueryList media) Creates a stand-alone author style sheet.protected abstract DocumentCSSStyleSheet
Get the style sheet resulting from the merge of the user agent sheet and the non-important part of the user style sheet.protected abstract EnumSet
<Parser.Flag> Get the parser flags that should be used by NSAC parsers.abstract TypedValue
getSystemDefaultValue
(String propertyName) Get a system default value for the given property.protected abstract AbstractCSSStyleSheet
Get the priority-important part of the user style sheet, i.e. the style sheet with the declarations ofimportant
priority.protected abstract AbstractCSSStyleSheet
Get the normal part of the user style sheet, i.e. the style sheet with the declarations of normal priority.protected abstract ValueFactory
Get a value factory set to the appropriate flags.protected abstract boolean
Check for compat value flags.protected abstract boolean
hasFactoryFlag
(short flag) Check whether the given factory flag is set.abstract void
Sets a default HTML default style sheet as the user agent style sheet.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.sf.carte.doc.style.css.CSSStyleSheetFactory
createImmutableMediaQueryList, createInlineStyleErrorHandler, createMediaQueryList, createPropertyDefinition, createSheetErrorHandler, createStyleDeclarationErrorHandler, getDeviceFactory, getStyleFormattingFactory, getUserAgentStyleSheet, setFactoryFlag, setLenientSystemValues, setStyleFormattingFactory, setUserStyleSheet, setUserStyleSheet
-
Field Details
-
STRING_SINGLE_QUOTE
Deprecated, for removal: This API element is subject to removal in a future version.Prefer single quotes in the serialization of strings.- See Also:
-
STRING_DOUBLE_QUOTE
Deprecated, for removal: This API element is subject to removal in a future version.Prefer double quotes in the serialization of strings.- See Also:
-
-
Constructor Details
-
AbstractCSSStyleSheetFactory
public AbstractCSSStyleSheetFactory()
-
-
Method Details
-
createInlineStyle
Create an inline style.- Parameters:
owner
- the style's owner node (an attribute node).- Returns:
- the inline style.
-
createStyleSheet
Description copied from interface:CSSStyleSheetFactory
Creates a stand-alone author style sheet.- Specified by:
createStyleSheet
in interfaceCSSStyleSheetFactory
- Parameters:
title
- the advisory title.media
- the target media for style.- Returns:
- the style sheet.
-
createRuleStyleSheet
protected abstract AbstractCSSStyleSheet createRuleStyleSheet(AbstractCSSRule ownerRule, String title, MediaQueryList mediaList) Creates a CSS style sheet owned by a CSS rule.- Parameters:
ownerRule
- the owner rule.title
- the advisory title.mediaList
- the list of target media for style.- Returns:
- the style sheet.
-
createLinkedStyleSheet
protected abstract AbstractCSSStyleSheet createLinkedStyleSheet(Node ownerNode, String title, MediaQueryList mediaList) Creates an author (document-linked) CSS style sheet.- Parameters:
ownerNode
- the node that associates the style sheet to the document. In HTML it can be alink
orstyle
element. For style sheets that are included by other style sheets, the value of this parameter isnull
.title
- the advisory title.mediaList
- the target media list for style.- Returns:
- the style sheet.
-
createAnonymousStyleDeclaration
Description copied from interface:CSSStyleSheetFactory
Create a style declaration for an anonymous inline box, associated to a text/cdata node.- Specified by:
createAnonymousStyleDeclaration
in interfaceCSSStyleSheetFactory
- Parameters:
node
- the node that has the declaration associated to it.- Returns:
- the anonymous style declaration.
-
getSystemDefaultValue
Description copied from interface:CSSStyleSheetFactory
Get a system default value for the given property.If the
lenientSystemValues
flag istrue
, returns a reasonable default for the property. Otherwise, it returns a system default meta-value.- Specified by:
getSystemDefaultValue
in interfaceCSSStyleSheetFactory
- Parameters:
propertyName
- the property name.- Returns:
- the system default css primitive value.
-
createSACParser
Create a NSAC Parser with the proper flags enabled.- Returns:
- the NSAC parser.
-
getParserFlags
Get the parser flags that should be used by NSAC parsers.- Returns:
- the NSAC parser flags.
-
hasCompatValueFlags
protected abstract boolean hasCompatValueFlags()Check for compat value flags.- Returns:
true
if the factory has compat value flags set.
-
hasFactoryFlag
protected abstract boolean hasFactoryFlag(short flag) Check whether the given factory flag is set.- Parameters:
flag
- the flag.- Returns:
true
if the flag is set.
-
getValueFactory
Get a value factory set to the appropriate flags.- Returns:
- the value factory.
-
getUserImportantStyleSheet
Get the priority-important part of the user style sheet, i.e. the style sheet with the declarations ofimportant
priority.- Returns:
- the important part of the user style sheet.
-
getUserNormalStyleSheet
Get the normal part of the user style sheet, i.e. the style sheet with the declarations of normal priority.- Returns:
- the normal part of the user style sheet.
-
setDefaultHTMLUserAgentSheet
public abstract void setDefaultHTMLUserAgentSheet()Sets a default HTML default style sheet as the user agent style sheet.The sheet will be appropriately merged with the non-important part of the user-preference style sheet to provide the document's default sheet.
- Specified by:
setDefaultHTMLUserAgentSheet
in interfaceCSSStyleSheetFactory
-
getDefaultStyleSheet
Get the style sheet resulting from the merge of the user agent sheet and the non-important part of the user style sheet.- Parameters:
mode
- the compliance mode.- Returns:
- the default style sheet at the top of the cascade.
-
CSSStyleSheetFactory.FLAG_STRING_DOUBLE_QUOTE