Class CSSOMParser


  • public class CSSOMParser
    extends Object
    Author:
    Ronald Brill
    • 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)

        setErrorHandler.

        Parameters:
        eh - the error handler to be used
      • parseStyleSheet

        public CSSStyleSheetImpl parseStyleSheet​(InputSource source,
                                                 String href)
                                          throws IOException
        Parses a SAC input source into a CSSOM style sheet.
        Parameters:
        source - the SAC input source
        href - the href
        Returns:
        the CSSOM style sheet
        Throws:
        IOException - if the underlying SAC parser throws an IOException
      • parseStyleDeclaration

        public CSSStyleDeclarationImpl parseStyleDeclaration​(String styleDecl)
                                                      throws IOException
        Parses a input string into a CSSOM style declaration.
        Parameters:
        styleDecl - the input string
        Returns:
        the CSSOM style declaration
        Throws:
        IOException - if the underlying SAC parser throws an IOException
      • parseStyleDeclaration

        public void parseStyleDeclaration​(CSSStyleDeclarationImpl sd,
                                          String styleDecl)
                                   throws IOException
        Parses a input string into a CSSOM style declaration.
        Parameters:
        styleDecl - the input string
        sd - the CSSOM style declaration
        Throws:
        IOException - if the underlying SAC parser throws an IOException
      • parsePropertyValue

        public CSSValueImpl parsePropertyValue​(String propertyValue)
                                        throws IOException
        Parses a input string into a CSSValue.
        Parameters:
        propertyValue - the input string
        Returns:
        the css value
        Throws:
        IOException - if the underlying SAC parser throws an IOException
      • parseRule

        public AbstractCSSRuleImpl parseRule​(String rule)
                                      throws IOException
        Parses a string into a CSSRule.
        Parameters:
        rule - the input string
        Returns:
        the css rule
        Throws:
        IOException - if the underlying SAC parser throws an IOException
      • parseSelectors

        public SelectorList parseSelectors​(String selectors)
                                    throws IOException
        Parses a string into a CSSSelectorList.
        Parameters:
        selectors - the input string
        Returns:
        the css selector list
        Throws:
        IOException - if the underlying SAC parser throws an IOException
      • parseMedia

        public MediaQueryList parseMedia​(String media)
                                  throws IOException
        Parses a string into a MediaQueryList.
        Parameters:
        media - the input string
        Returns:
        the css media query list
        Throws:
        IOException - if the underlying SAC parser throws an IOException
      • setParentStyleSheet

        public void setParentStyleSheet​(CSSStyleSheetImpl parentStyleSheet)

        setParentStyleSheet.

        Parameters:
        parentStyleSheet - the new parent stylesheet
      • getParentStyleSheet

        protected CSSStyleSheetImpl getParentStyleSheet()

        getParentStyleSheet.

        Returns:
        the parent style sheet