public class StylesheetFactoryImpl extends Object implements StylesheetFactory
| Constructor and Description |
|---|
StylesheetFactoryImpl(UserAgentCallback userAgentCallback) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsStylesheet(String key) |
void |
flushCachedStylesheets() |
Stylesheet |
getCachedStylesheet(String key)
Returns a cached sheet by its key; null if no entry for that key.
|
Stylesheet |
getStylesheet(StylesheetInfo info)
Returns a cached sheet by its key; loads and caches it if not in cache;
null if not able to load
|
Stylesheet |
parse(Reader reader,
StylesheetInfo info) |
Ruleset |
parseStyleDeclaration(int origin,
String styleDeclaration) |
void |
putStylesheet(String key,
Stylesheet sheet)
Adds a stylesheet to the factory cache.
|
Stylesheet |
removeCachedStylesheet(String key)
Removes a cached sheet by its key.
|
void |
setSupportCMYKColors(boolean b) |
void |
setUserAgentCallback(UserAgentCallback userAgent) |
public StylesheetFactoryImpl(UserAgentCallback userAgentCallback)
public Stylesheet parse(Reader reader, StylesheetInfo info)
parse in interface StylesheetFactorypublic Ruleset parseStyleDeclaration(int origin, String styleDeclaration)
parseStyleDeclaration in interface StylesheetFactorypublic void putStylesheet(String key, Stylesheet sheet)
key - Key to use to reference sheet later; must be unique in
factory.sheet - The sheet to cache.public boolean containsStylesheet(String key)
public Stylesheet getCachedStylesheet(String key)
key - The key for this sheet; same as key passed to
putStylesheet();public Stylesheet removeCachedStylesheet(String key)
key - The key for this sheet; same as key passed to
putStylesheet();public void flushCachedStylesheets()
public Stylesheet getStylesheet(StylesheetInfo info)
getStylesheet in interface StylesheetFactoryinfo - The StylesheetInfo for this sheetpublic void setUserAgentCallback(UserAgentCallback userAgent)
public void setSupportCMYKColors(boolean b)
Copyright © 2023. All rights reserved.