org.apache.batik.css.parser
Class ExtendedParserWrapper

java.lang.Object
  extended by 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.


Field Summary
 org.w3c.css.sac.Parser parser
           
 
Constructor Summary
ExtendedParserWrapper(org.w3c.css.sac.Parser parser)
           
 
Method Summary
 String getParserVersion()
          SAC: Implements Parser.getParserVersion().
 org.w3c.css.sac.SACMediaList parseMedia(String mediaText)
          Implements ExtendedParser.parseMedia(String).
 boolean parsePriority(org.w3c.css.sac.InputSource source)
          SAC: Implements Parser.parsePriority(InputSource).
 boolean parsePriority(String source)
          Parse a CSS priority value (e.g. "!important").
 org.w3c.css.sac.LexicalUnit parsePropertyValue(org.w3c.css.sac.InputSource source)
          SAC: Implements Parser.parsePropertyValue(InputSource).
 org.w3c.css.sac.LexicalUnit parsePropertyValue(String source)
          Parse a CSS property value.
 void parseRule(org.w3c.css.sac.InputSource source)
          SAC: Implements Parser.parseRule(InputSource).
 void parseRule(String source)
          Parse a CSS rule.
 org.w3c.css.sac.SelectorList parseSelectors(org.w3c.css.sac.InputSource source)
          SAC: Implements Parser.parseSelectors(InputSource).
 org.w3c.css.sac.SelectorList parseSelectors(String source)
          Parse a comma separated list of selectors.
 void parseStyleDeclaration(org.w3c.css.sac.InputSource source)
          SAC: Implements Parser.parseStyleDeclaration(InputSource).
 void parseStyleDeclaration(String source)
          Parse a CSS style declaration (without '{' and '}').
 void parseStyleSheet(org.w3c.css.sac.InputSource source)
          SAC: Implements Parser.parseStyleSheet(InputSource).
 void parseStyleSheet(String uri)
          Parse a CSS document from a URI.
 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).
static ExtendedParser 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 Detail

parser

public org.w3c.css.sac.Parser parser
Constructor Detail

ExtendedParserWrapper

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

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:
parseStyleSheet(InputSource)

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
Implements ExtendedParser.parseMedia(String).

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.


Copyright © 2008 Apache Software Foundation. All Rights Reserved.