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
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AbstractCSSStyleDeclarationCreate a style declaration for an anonymous inline box, associated to a text/cdata node.protected abstract InlineStylecreateInlineStyle(Node owner) Create an inline style.protected abstract AbstractCSSStyleSheetcreateLinkedStyleSheet(Node ownerNode, String title, MediaQueryList mediaList) Creates an author (document-linked) CSS style sheet.protected abstract AbstractCSSStyleSheetcreateRuleStyleSheet(AbstractCSSRule ownerRule, String title, MediaQueryList mediaList) Creates a CSS style sheet owned by a CSS rule.protected abstract ParserCreate a NSAC Parser with the proper flags enabled.abstract AbstractCSSStyleSheetcreateStyleSheet(String title, MediaQueryList media) Creates a stand-alone author style sheet.protected abstract DocumentCSSStyleSheetGet 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 TypedValuegetSystemDefaultValue(String propertyName) Get a system default value for the given property.protected abstract AbstractCSSStyleSheetGet the priority-important part of the user style sheet, i.e. the style sheet with the declarations ofimportantpriority.protected abstract AbstractCSSStyleSheetGet the normal part of the user style sheet, i.e. the style sheet with the declarations of normal priority.protected abstract ValueFactoryGet a value factory set to the appropriate flags.protected abstract booleanCheck for Internet Explorer legacy compatibility value flags.protected abstract booleanhasFactoryFlag(short flag) Check whether the given factory flag is set.abstract voidSets a default HTML default style sheet as the user agent style sheet.abstract booleansetFlag(Parser.Flag flag) Set the given parser flag.abstract booleanunsetFlag(Parser.Flag flag) Unset the given parser flag.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.sf.carte.doc.style.css.CSSStyleSheetFactory
createImmutableMediaQueryList, createInlineStyleErrorHandler, createMediaQueryList, createPropertyDefinition, createSheetErrorHandler, createStyleDeclarationErrorHandler, getDeviceFactory, getStyleFormattingFactory, getUserAgentStyleSheet, setFactoryFlag, setLenientSystemValues, setStyleFormattingFactory, setUserStyleSheet, setUserStyleSheet
-
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:CSSStyleSheetFactoryCreates a stand-alone author style sheet.- Specified by:
createStyleSheetin 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 alinkorstyleelement. 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:CSSStyleSheetFactoryCreate a style declaration for an anonymous inline box, associated to a text/cdata node.- Specified by:
createAnonymousStyleDeclarationin interfaceCSSStyleSheetFactory- Parameters:
node- the node that has the declaration associated to it.- Returns:
- the anonymous style declaration.
-
getSystemDefaultValue
Description copied from interface:CSSStyleSheetFactoryGet a system default value for the given property.If the
lenientSystemValuesflag istrue, returns a reasonable default for the property. Otherwise, it returns a system default meta-value.- Specified by:
getSystemDefaultValuein 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.
-
setFlag
Set the given parser flag.- Parameters:
flag- the flag.- Returns:
trueif the flag was newly set,falseif the flag was already set.
-
unsetFlag
Unset the given parser flag.- Parameters:
flag- the flag.- Returns:
trueif the flag was unset,falseif the flag was not set.
-
hasCompatValueFlags
protected abstract boolean hasCompatValueFlags()Check for Internet Explorer legacy compatibility value flags.- Returns:
trueif the factory has any compatibility value flags set (note:STARHACKis not considered a value flag).
-
hasFactoryFlag
protected abstract boolean hasFactoryFlag(short flag) Check whether the given factory flag is set.- Parameters:
flag- the flag.- Returns:
trueif 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 ofimportantpriority.- 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:
setDefaultHTMLUserAgentSheetin 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.
-