Class ExtendedParserWrapper

java.lang.Object
org.apache.batik.css.parser.ExtendedParserWrapper
All Implemented Interfaces:
ExtendedParser, org.w3c.css.sac.Parser

public class ExtendedParserWrapper extends Object implements ExtendedParser
This class implements the ExtendedParser interface by wrapping a standard Parser.
Version:
$Id: ExtendedParserWrapper.java 1733416 2016-03-03 07:07:13Z gadams $
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    org.w3c.css.sac.Parser
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExtendedParserWrapper(org.w3c.css.sac.Parser parser)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    SAC: Implements Parser.getParserVersion().
    org.w3c.css.sac.SACMediaList
    parseMedia(String mediaText)
    boolean
    Parse a CSS priority value (e.g. "!important").
    boolean
    parsePriority(org.w3c.css.sac.InputSource source)
    SAC: Implements Parser.parsePriority(InputSource).
    org.w3c.css.sac.LexicalUnit
    Parse a CSS property value.
    org.w3c.css.sac.LexicalUnit
    parsePropertyValue(org.w3c.css.sac.InputSource source)
    SAC: Implements Parser.parsePropertyValue(InputSource).
    void
    parseRule(String source)
    Parse a CSS rule.
    void
    parseRule(org.w3c.css.sac.InputSource source)
    SAC: Implements Parser.parseRule(InputSource).
    org.w3c.css.sac.SelectorList
    Parse a comma separated list of selectors.
    org.w3c.css.sac.SelectorList
    parseSelectors(org.w3c.css.sac.InputSource source)
    SAC: Implements Parser.parseSelectors(InputSource).
    void
    Parse a CSS style declaration (without '{' and '}').
    void
    parseStyleDeclaration(org.w3c.css.sac.InputSource source)
    SAC: Implements Parser.parseStyleDeclaration(InputSource).
    void
    Parse a CSS document from a URI.
    void
    parseStyleSheet(org.w3c.css.sac.InputSource source)
    SAC: Implements Parser.parseStyleSheet(InputSource).
    void
    setConditionFactory(org.w3c.css.sac.ConditionFactory conditionFactory)
    SAC: Implements Parser.setConditionFactory(ConditionFactory).
    void
    setDocumentHandler(org.w3c.css.sac.DocumentHandler handler)
    SAC: Implements Parser.setDocumentHandler(DocumentHandler).
    void
    setErrorHandler(org.w3c.css.sac.ErrorHandler handler)
    SAC: Implements Parser.setErrorHandler(ErrorHandler).
    void
    setLocale(Locale locale)
    SAC: Implements Parser.setLocale(Locale).
    void
    setSelectorFactory(org.w3c.css.sac.SelectorFactory selectorFactory)
    SAC: Implements Parser.setSelectorFactory(SelectorFactory).
    wrap(org.w3c.css.sac.Parser p)
    This converts a standard @link org.w3c.css.sac.Parser into an Extended Parser.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • parser

      public org.w3c.css.sac.Parser parser
  • Constructor Details

    • ExtendedParserWrapper

      public ExtendedParserWrapper(org.w3c.css.sac.Parser parser)
  • Method Details

    • wrap

      public static ExtendedParser wrap(org.w3c.css.sac.Parser p)
      This converts a standard @link org.w3c.css.sac.Parser into an Extended Parser. If it is already an ExtendedParser it will simply cast it and return, otherwise it will wrap it and return the result.
      Parameters:
      p - Parser to wrap.
      Returns:
      p as an ExtendedParser.
    • getParserVersion

      public String getParserVersion()
      SAC: Implements Parser.getParserVersion().
      Specified by:
      getParserVersion in interface org.w3c.css.sac.Parser
    • setLocale

      public void setLocale(Locale locale) throws org.w3c.css.sac.CSSException
      SAC: Implements Parser.setLocale(Locale).
      Specified by:
      setLocale in interface org.w3c.css.sac.Parser
      Throws:
      org.w3c.css.sac.CSSException
    • setDocumentHandler

      public void setDocumentHandler(org.w3c.css.sac.DocumentHandler handler)
      SAC: Implements Parser.setDocumentHandler(DocumentHandler).
      Specified by:
      setDocumentHandler in interface org.w3c.css.sac.Parser
    • setSelectorFactory

      public void setSelectorFactory(org.w3c.css.sac.SelectorFactory selectorFactory)
      SAC: Implements Parser.setSelectorFactory(SelectorFactory).
      Specified by:
      setSelectorFactory in interface org.w3c.css.sac.Parser
    • setConditionFactory

      public void setConditionFactory(org.w3c.css.sac.ConditionFactory conditionFactory)
      SAC: Implements Parser.setConditionFactory(ConditionFactory).
      Specified by:
      setConditionFactory in interface org.w3c.css.sac.Parser
    • setErrorHandler

      public void setErrorHandler(org.w3c.css.sac.ErrorHandler handler)
      SAC: Implements Parser.setErrorHandler(ErrorHandler).
      Specified by:
      setErrorHandler in interface org.w3c.css.sac.Parser
    • parseStyleSheet

      public void parseStyleSheet(org.w3c.css.sac.InputSource source) throws org.w3c.css.sac.CSSException, IOException
      SAC: Implements Parser.parseStyleSheet(InputSource).
      Specified by:
      parseStyleSheet in interface org.w3c.css.sac.Parser
      Throws:
      org.w3c.css.sac.CSSException
      IOException
    • parseStyleSheet

      public void parseStyleSheet(String uri) throws org.w3c.css.sac.CSSException, IOException
      Parse a CSS document from a URI.

      This method is a shortcut for the common case of reading a document from a URI. It is the exact equivalent of the following:

       parse(new InputSource(uri));
       

      The URI must be fully resolved by the application before it is passed to the parser.

      Specified by:
      parseStyleSheet in interface org.w3c.css.sac.Parser
      Parameters:
      uri - The URI.
      Throws:
      org.w3c.css.sac.CSSException - Any CSS exception, possibly wrapping another exception.
      IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
      See Also:
    • parseStyleDeclaration

      public void parseStyleDeclaration(org.w3c.css.sac.InputSource source) throws org.w3c.css.sac.CSSException, IOException
      SAC: Implements Parser.parseStyleDeclaration(InputSource).
      Specified by:
      parseStyleDeclaration in interface org.w3c.css.sac.Parser
      Throws:
      org.w3c.css.sac.CSSException
      IOException
    • parseStyleDeclaration

      public void parseStyleDeclaration(String source) throws org.w3c.css.sac.CSSException, IOException
      Parse a CSS style declaration (without '{' and '}').
      Specified by:
      parseStyleDeclaration in interface ExtendedParser
      Parameters:
      source - The declaration.
      Throws:
      org.w3c.css.sac.CSSException - Any CSS exception, possibly wrapping another exception.
      IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
    • parseRule

      public void parseRule(org.w3c.css.sac.InputSource source) throws org.w3c.css.sac.CSSException, IOException
      SAC: Implements Parser.parseRule(InputSource).
      Specified by:
      parseRule in interface org.w3c.css.sac.Parser
      Throws:
      org.w3c.css.sac.CSSException
      IOException
    • parseRule

      public void parseRule(String source) throws org.w3c.css.sac.CSSException, IOException
      Parse a CSS rule.
      Specified by:
      parseRule in interface ExtendedParser
      Throws:
      org.w3c.css.sac.CSSException - Any CSS exception, possibly wrapping another exception.
      IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
    • parseSelectors

      public org.w3c.css.sac.SelectorList parseSelectors(org.w3c.css.sac.InputSource source) throws org.w3c.css.sac.CSSException, IOException
      SAC: Implements Parser.parseSelectors(InputSource).
      Specified by:
      parseSelectors in interface org.w3c.css.sac.Parser
      Throws:
      org.w3c.css.sac.CSSException
      IOException
    • parseSelectors

      public org.w3c.css.sac.SelectorList parseSelectors(String source) throws org.w3c.css.sac.CSSException, IOException
      Parse a comma separated list of selectors.
      Specified by:
      parseSelectors in interface ExtendedParser
      Throws:
      org.w3c.css.sac.CSSException - Any CSS exception, possibly wrapping another exception.
      IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
    • parsePropertyValue

      public org.w3c.css.sac.LexicalUnit parsePropertyValue(org.w3c.css.sac.InputSource source) throws org.w3c.css.sac.CSSException, IOException
      SAC: Implements Parser.parsePropertyValue(InputSource).
      Specified by:
      parsePropertyValue in interface org.w3c.css.sac.Parser
      Throws:
      org.w3c.css.sac.CSSException
      IOException
    • parsePropertyValue

      public org.w3c.css.sac.LexicalUnit parsePropertyValue(String source) throws org.w3c.css.sac.CSSException, IOException
      Parse a CSS property value.
      Specified by:
      parsePropertyValue in interface ExtendedParser
      Throws:
      org.w3c.css.sac.CSSException - Any CSS exception, possibly wrapping another exception.
      IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
    • parsePriority

      public boolean parsePriority(org.w3c.css.sac.InputSource source) throws org.w3c.css.sac.CSSException, IOException
      SAC: Implements Parser.parsePriority(InputSource).
      Specified by:
      parsePriority in interface org.w3c.css.sac.Parser
      Throws:
      org.w3c.css.sac.CSSException
      IOException
    • parseMedia

      public org.w3c.css.sac.SACMediaList parseMedia(String mediaText) throws org.w3c.css.sac.CSSException, IOException
      Specified by:
      parseMedia in interface ExtendedParser
      Throws:
      org.w3c.css.sac.CSSException - Any CSS exception, possibly wrapping another exception.
      IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
    • parsePriority

      public boolean parsePriority(String source) throws org.w3c.css.sac.CSSException, IOException
      Parse a CSS priority value (e.g. "!important").
      Specified by:
      parsePriority in interface ExtendedParser
      Throws:
      org.w3c.css.sac.CSSException - Any CSS exception, possibly wrapping another exception.
      IOException - An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.