public class CSSParserFactory extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CSSParserFactory.SourceType
Source types.
|
| Modifier | Constructor and Description |
|---|---|
protected |
CSSParserFactory()
dummy constructor for singleton
|
| Modifier and Type | Method and Description |
|---|---|
protected static StyleSheet |
addRulesToStyleSheet(RuleList rules,
StyleSheet sheet) |
StyleSheet |
append(Object source,
NetworkProcessor network,
String encoding,
CSSParserFactory.SourceType type,
Element inline,
boolean inlinePriority,
StyleSheet sheet,
URL base)
Appends parsed source to passed style sheet.
|
StyleSheet |
append(Object source,
NetworkProcessor network,
String encoding,
CSSParserFactory.SourceType type,
StyleSheet sheet,
URL base)
Appends parsed source to passed style sheet.
|
protected static CSSException |
encapsulateException(Throwable t,
String msg)
Creates new CSSException which encapsulates cause
|
protected static CSSInputStream |
getInput(Object source,
NetworkProcessor network,
String encoding,
CSSParserFactory.SourceType type) |
static CSSParserFactory |
getInstance()
get instance singleton method
|
StyleSheet |
parse(Object source,
NetworkProcessor network,
String encoding,
CSSParserFactory.SourceType type,
Element inline,
boolean inlinePriority,
URL base)
Parses source of given type
|
StyleSheet |
parse(Object source,
NetworkProcessor network,
String encoding,
CSSParserFactory.SourceType type,
URL base)
Parses source of given type.
|
protected StyleSheet |
parseAndImport(Object source,
NetworkProcessor network,
String encoding,
CSSParserFactory.SourceType type,
StyleSheet sheet,
Preparator preparator,
URL base,
List<MediaQuery> media)
Parses the source using the given infrastructure and returns the resulting style sheet.
|
List<MediaQuery> |
parseMediaQuery(String query)
Parses a media query from a string (e.g. the 'media' HTML attribute).
|
public static CSSParserFactory getInstance()
public StyleSheet parse(Object source, NetworkProcessor network, String encoding, CSSParserFactory.SourceType type, Element inline, boolean inlinePriority, URL base) throws IOException, CSSException
source - Source, interpretation depends on typetype - Type of source providedinline - InlineElementinlinePriority - True when the rule should have an 'inline' (greater) priorityIOException - When problem with input stream occursCSSException - When unrecoverable exception during parsing occurspublic StyleSheet parse(Object source, NetworkProcessor network, String encoding, CSSParserFactory.SourceType type, URL base) throws IOException, CSSException
source - Source, interpretation depends on typetype - Type of source providedbase - The base URLIOException - When problem with input stream occursCSSException - When unrecoverable exception during parsing occursIllegalArgumentException - When type of source is INLINEpublic StyleSheet append(Object source, NetworkProcessor network, String encoding, CSSParserFactory.SourceType type, Element inline, boolean inlinePriority, StyleSheet sheet, URL base) throws IOException, CSSException
source - Source, interpretation depends on typetype - Type of source providedinline - Inline elementinlinePriority - True when the rule should have an 'inline' (greater) prioritysheet - StyleSheet to be modifiedIOException - When problem with input stream occursCSSException - When unrecoverable exception during parsing occurspublic StyleSheet append(Object source, NetworkProcessor network, String encoding, CSSParserFactory.SourceType type, StyleSheet sheet, URL base) throws IOException, CSSException
source - Source, interpretation depends on typetype - Type of source providedbase - Base urlsheet - StyleSheet to be modifiedIOException - When problem with input stream occursCSSException - When unrecoverable exception during parsing occursIllegalArgumentException - When type of source is INLINEprotected StyleSheet parseAndImport(Object source, NetworkProcessor network, String encoding, CSSParserFactory.SourceType type, StyleSheet sheet, Preparator preparator, URL base, List<MediaQuery> media) throws CSSException, IOException
CSSExceptionIOExceptionpublic List<MediaQuery> parseMediaQuery(String query)
query - The query stringprotected static CSSException encapsulateException(Throwable t, String msg)
t - Causemsg - Messageprotected static StyleSheet addRulesToStyleSheet(RuleList rules, StyleSheet sheet)
protected static CSSInputStream getInput(Object source, NetworkProcessor network, String encoding, CSSParserFactory.SourceType type) throws IOException
IOExceptionCopyright © 2018. All rights reserved.