Package org.xhtmlrenderer.css.sheet
Class Stylesheet
- java.lang.Object
-
- org.xhtmlrenderer.css.sheet.Stylesheet
-
- All Implemented Interfaces:
RulesetContainer
public class Stylesheet extends java.lang.Object implements RulesetContainer
A representation of a CSS style sheet. A Stylesheet has the sheet's rules inRuleset, and has an origin--either user agent, user, or author. A Stylesheet can only be instantiated from a SAC CSSStyleSheet instance-- this would be the output of a SAC-compliant parser after parsing a CSS stream or source. A Stylesheet is immutable; after instantiation, you can query the origin and theRuleset, but not modify either of them.- Author:
- Torbjörn Gannholm, Patrick Wright
-
-
Constructor Summary
Constructors Constructor Description Stylesheet(java.lang.String uri, int origin)Creates a new instance of Stylesheet
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddContent(MediaRule rule)voidaddContent(PageRule rule)voidaddContent(Ruleset ruleset)voidaddFontFaceRule(FontFaceRule rule)voidaddImportRule(StylesheetInfo info)java.util.ListgetContents()java.util.ListgetFontFaceRules()java.util.ListgetImportRules()intgetOrigin()Gets the origin attribute of the Stylesheet objectjava.lang.StringgetURI()Gets the URI of the Stylesheet object
-
-
-
Method Detail
-
getOrigin
public int getOrigin()
Gets the origin attribute of the Stylesheet object- Specified by:
getOriginin interfaceRulesetContainer- Returns:
- The origin value
-
getURI
public java.lang.String getURI()
Gets the URI of the Stylesheet object- Returns:
- The URI
-
addContent
public void addContent(Ruleset ruleset)
- Specified by:
addContentin interfaceRulesetContainer
-
addContent
public void addContent(MediaRule rule)
-
addContent
public void addContent(PageRule rule)
-
getContents
public java.util.List getContents()
-
addImportRule
public void addImportRule(StylesheetInfo info)
-
getImportRules
public java.util.List getImportRules()
-
addFontFaceRule
public void addFontFaceRule(FontFaceRule rule)
-
getFontFaceRules
public java.util.List getFontFaceRules()
-
-