Package org.htmlunit.cssparser.parser
Class CSSOMParser
- java.lang.Object
-
- org.htmlunit.cssparser.parser.CSSOMParser
-
public class CSSOMParser extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
CSSOMParser.CSSOMHandler
-
Field Summary
Fields Modifier and Type Field Description private CSSStyleSheetImpl
parentStyleSheet_
private AbstractCSSParser
parser_
-
Constructor Summary
Constructors Constructor Description CSSOMParser()
Creates new CSSOMParser.CSSOMParser(AbstractCSSParser parser)
Creates new CSSOMParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CSSStyleSheetImpl
getParentStyleSheet()
MediaQueryList
parseMedia(java.lang.String media)
Parses a string into a MediaQueryList.CSSValueImpl
parsePropertyValue(java.lang.String propertyValue)
Parses a input string into a CSSValue.AbstractCSSRuleImpl
parseRule(java.lang.String rule)
Parses a string into a CSSRule.SelectorList
parseSelectors(java.lang.String selectors)
Parses a string into a CSSSelectorList.CSSStyleDeclarationImpl
parseStyleDeclaration(java.lang.String styleDecl)
Parses a input string into a CSSOM style declaration.void
parseStyleDeclaration(CSSStyleDeclarationImpl sd, java.lang.String styleDecl)
Parses a input string into a CSSOM style declaration.CSSStyleSheetImpl
parseStyleSheet(InputSource source, java.lang.String href)
Parses a SAC input source into a CSSOM style sheet.void
setErrorHandler(CSSErrorHandler eh)
void
setParentStyleSheet(CSSStyleSheetImpl parentStyleSheet)
-
-
-
Field Detail
-
parser_
private final AbstractCSSParser parser_
-
parentStyleSheet_
private CSSStyleSheetImpl parentStyleSheet_
-
-
Constructor Detail
-
CSSOMParser
public CSSOMParser(AbstractCSSParser parser)
Creates new CSSOMParser.- Parameters:
parser
- the parser
-
CSSOMParser
public CSSOMParser()
Creates new CSSOMParser.
-
-
Method Detail
-
setErrorHandler
public void setErrorHandler(CSSErrorHandler eh)
- Parameters:
eh
- the error handler to be used
-
parseStyleSheet
public CSSStyleSheetImpl parseStyleSheet(InputSource source, java.lang.String href) throws java.io.IOException
Parses a SAC input source into a CSSOM style sheet.- Parameters:
source
- the SAC input sourcehref
- the href- Returns:
- the CSSOM style sheet
- Throws:
java.io.IOException
- if the underlying SAC parser throws an IOException
-
parseStyleDeclaration
public CSSStyleDeclarationImpl parseStyleDeclaration(java.lang.String styleDecl) throws java.io.IOException
Parses a input string into a CSSOM style declaration.- Parameters:
styleDecl
- the input string- Returns:
- the CSSOM style declaration
- Throws:
java.io.IOException
- if the underlying SAC parser throws an IOException
-
parseStyleDeclaration
public void parseStyleDeclaration(CSSStyleDeclarationImpl sd, java.lang.String styleDecl) throws java.io.IOException
Parses a input string into a CSSOM style declaration.- Parameters:
styleDecl
- the input stringsd
- the CSSOM style declaration- Throws:
java.io.IOException
- if the underlying SAC parser throws an IOException
-
parsePropertyValue
public CSSValueImpl parsePropertyValue(java.lang.String propertyValue) throws java.io.IOException
Parses a input string into a CSSValue.- Parameters:
propertyValue
- the input string- Returns:
- the css value
- Throws:
java.io.IOException
- if the underlying SAC parser throws an IOException
-
parseRule
public AbstractCSSRuleImpl parseRule(java.lang.String rule) throws java.io.IOException
Parses a string into a CSSRule.- Parameters:
rule
- the input string- Returns:
- the css rule
- Throws:
java.io.IOException
- if the underlying SAC parser throws an IOException
-
parseSelectors
public SelectorList parseSelectors(java.lang.String selectors) throws java.io.IOException
Parses a string into a CSSSelectorList.- Parameters:
selectors
- the input string- Returns:
- the css selector list
- Throws:
java.io.IOException
- if the underlying SAC parser throws an IOException
-
parseMedia
public MediaQueryList parseMedia(java.lang.String media) throws java.io.IOException
Parses a string into a MediaQueryList.- Parameters:
media
- the input string- Returns:
- the css media query list
- Throws:
java.io.IOException
- if the underlying SAC parser throws an IOException
-
setParentStyleSheet
public void setParentStyleSheet(CSSStyleSheetImpl parentStyleSheet)
- Parameters:
parentStyleSheet
- the new parent stylesheet
-
getParentStyleSheet
protected CSSStyleSheetImpl getParentStyleSheet()
- Returns:
- the parent style sheet
-
-