Package org.apache.batik.css.parser
Class ExtendedParserWrapper
- java.lang.Object
-
- org.apache.batik.css.parser.ExtendedParserWrapper
-
- All Implemented Interfaces:
ExtendedParser
,org.w3c.css.sac.Parser
public class ExtendedParserWrapper extends java.lang.Object implements ExtendedParser
This class implements theExtendedParser
interface by wrapping a standardParser
.
-
-
Field Summary
Fields Modifier and Type Field Description org.w3c.css.sac.Parser
parser
-
Constructor Summary
Constructors Constructor Description ExtendedParserWrapper(org.w3c.css.sac.Parser parser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getParserVersion()
SAC: ImplementsParser.getParserVersion()
.org.w3c.css.sac.SACMediaList
parseMedia(java.lang.String mediaText)
ImplementsExtendedParser.parseMedia(String)
.boolean
parsePriority(java.lang.String source)
Parse a CSS priority value (e.g. "!important").boolean
parsePriority(org.w3c.css.sac.InputSource source)
SAC: ImplementsParser.parsePriority(InputSource)
.org.w3c.css.sac.LexicalUnit
parsePropertyValue(java.lang.String source)
Parse a CSS property value.org.w3c.css.sac.LexicalUnit
parsePropertyValue(org.w3c.css.sac.InputSource source)
SAC: ImplementsParser.parsePropertyValue(InputSource)
.void
parseRule(java.lang.String source)
Parse a CSS rule.void
parseRule(org.w3c.css.sac.InputSource source)
SAC: ImplementsParser.parseRule(InputSource)
.org.w3c.css.sac.SelectorList
parseSelectors(java.lang.String source)
Parse a comma separated list of selectors.org.w3c.css.sac.SelectorList
parseSelectors(org.w3c.css.sac.InputSource source)
SAC: ImplementsParser.parseSelectors(InputSource)
.void
parseStyleDeclaration(java.lang.String source)
Parse a CSS style declaration (without '{' and '}').void
parseStyleDeclaration(org.w3c.css.sac.InputSource source)
SAC: ImplementsParser.parseStyleDeclaration(InputSource)
.void
parseStyleSheet(java.lang.String uri)
Parse a CSS document from a URI.void
parseStyleSheet(org.w3c.css.sac.InputSource source)
SAC: ImplementsParser.parseStyleSheet(InputSource)
.void
setConditionFactory(org.w3c.css.sac.ConditionFactory conditionFactory)
SAC: ImplementsParser.setConditionFactory(ConditionFactory)
.void
setDocumentHandler(org.w3c.css.sac.DocumentHandler handler)
SAC: ImplementsParser.setDocumentHandler(DocumentHandler)
.void
setErrorHandler(org.w3c.css.sac.ErrorHandler handler)
SAC: ImplementsParser.setErrorHandler(ErrorHandler)
.void
setLocale(java.util.Locale locale)
SAC: ImplementsParser.setLocale(Locale)
.void
setSelectorFactory(org.w3c.css.sac.SelectorFactory selectorFactory)
SAC: ImplementsParser.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.
-
-
-
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 java.lang.String getParserVersion()
SAC: ImplementsParser.getParserVersion()
.- Specified by:
getParserVersion
in interfaceorg.w3c.css.sac.Parser
-
setLocale
public void setLocale(java.util.Locale locale) throws org.w3c.css.sac.CSSException
SAC: ImplementsParser.setLocale(Locale)
.- Specified by:
setLocale
in interfaceorg.w3c.css.sac.Parser
- Throws:
org.w3c.css.sac.CSSException
-
setDocumentHandler
public void setDocumentHandler(org.w3c.css.sac.DocumentHandler handler)
SAC: ImplementsParser.setDocumentHandler(DocumentHandler)
.- Specified by:
setDocumentHandler
in interfaceorg.w3c.css.sac.Parser
-
setSelectorFactory
public void setSelectorFactory(org.w3c.css.sac.SelectorFactory selectorFactory)
SAC: ImplementsParser.setSelectorFactory(SelectorFactory)
.- Specified by:
setSelectorFactory
in interfaceorg.w3c.css.sac.Parser
-
setConditionFactory
public void setConditionFactory(org.w3c.css.sac.ConditionFactory conditionFactory)
SAC: ImplementsParser.setConditionFactory(ConditionFactory)
.- Specified by:
setConditionFactory
in interfaceorg.w3c.css.sac.Parser
-
setErrorHandler
public void setErrorHandler(org.w3c.css.sac.ErrorHandler handler)
SAC: ImplementsParser.setErrorHandler(ErrorHandler)
.- Specified by:
setErrorHandler
in interfaceorg.w3c.css.sac.Parser
-
parseStyleSheet
public void parseStyleSheet(org.w3c.css.sac.InputSource source) throws org.w3c.css.sac.CSSException, java.io.IOException
SAC: ImplementsParser.parseStyleSheet(InputSource)
.- Specified by:
parseStyleSheet
in interfaceorg.w3c.css.sac.Parser
- Throws:
org.w3c.css.sac.CSSException
java.io.IOException
-
parseStyleSheet
public void parseStyleSheet(java.lang.String uri) throws org.w3c.css.sac.CSSException, java.io.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 interfaceorg.w3c.css.sac.Parser
- Parameters:
uri
- The URI.- Throws:
org.w3c.css.sac.CSSException
- Any CSS exception, possibly wrapping another exception.java.io.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, java.io.IOException
SAC: ImplementsParser.parseStyleDeclaration(InputSource)
.- Specified by:
parseStyleDeclaration
in interfaceorg.w3c.css.sac.Parser
- Throws:
org.w3c.css.sac.CSSException
java.io.IOException
-
parseStyleDeclaration
public void parseStyleDeclaration(java.lang.String source) throws org.w3c.css.sac.CSSException, java.io.IOException
Parse a CSS style declaration (without '{' and '}').- Specified by:
parseStyleDeclaration
in interfaceExtendedParser
- Parameters:
source
- The declaration.- Throws:
org.w3c.css.sac.CSSException
- Any CSS exception, possibly wrapping another exception.java.io.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, java.io.IOException
SAC: ImplementsParser.parseRule(InputSource)
.- Specified by:
parseRule
in interfaceorg.w3c.css.sac.Parser
- Throws:
org.w3c.css.sac.CSSException
java.io.IOException
-
parseRule
public void parseRule(java.lang.String source) throws org.w3c.css.sac.CSSException, java.io.IOException
Parse a CSS rule.- Specified by:
parseRule
in interfaceExtendedParser
- Throws:
org.w3c.css.sac.CSSException
- Any CSS exception, possibly wrapping another exception.java.io.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, java.io.IOException
SAC: ImplementsParser.parseSelectors(InputSource)
.- Specified by:
parseSelectors
in interfaceorg.w3c.css.sac.Parser
- Throws:
org.w3c.css.sac.CSSException
java.io.IOException
-
parseSelectors
public org.w3c.css.sac.SelectorList parseSelectors(java.lang.String source) throws org.w3c.css.sac.CSSException, java.io.IOException
Parse a comma separated list of selectors.- Specified by:
parseSelectors
in interfaceExtendedParser
- Throws:
org.w3c.css.sac.CSSException
- Any CSS exception, possibly wrapping another exception.java.io.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, java.io.IOException
SAC: ImplementsParser.parsePropertyValue(InputSource)
.- Specified by:
parsePropertyValue
in interfaceorg.w3c.css.sac.Parser
- Throws:
org.w3c.css.sac.CSSException
java.io.IOException
-
parsePropertyValue
public org.w3c.css.sac.LexicalUnit parsePropertyValue(java.lang.String source) throws org.w3c.css.sac.CSSException, java.io.IOException
Parse a CSS property value.- Specified by:
parsePropertyValue
in interfaceExtendedParser
- Throws:
org.w3c.css.sac.CSSException
- Any CSS exception, possibly wrapping another exception.java.io.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, java.io.IOException
SAC: ImplementsParser.parsePriority(InputSource)
.- Specified by:
parsePriority
in interfaceorg.w3c.css.sac.Parser
- Throws:
org.w3c.css.sac.CSSException
java.io.IOException
-
parseMedia
public org.w3c.css.sac.SACMediaList parseMedia(java.lang.String mediaText) throws org.w3c.css.sac.CSSException, java.io.IOException
ImplementsExtendedParser.parseMedia(String)
.- Specified by:
parseMedia
in interfaceExtendedParser
- Throws:
org.w3c.css.sac.CSSException
- Any CSS exception, possibly wrapping another exception.java.io.IOException
- An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
-
parsePriority
public boolean parsePriority(java.lang.String source) throws org.w3c.css.sac.CSSException, java.io.IOException
Parse a CSS priority value (e.g. "!important").- Specified by:
parsePriority
in interfaceExtendedParser
- Throws:
org.w3c.css.sac.CSSException
- Any CSS exception, possibly wrapping another exception.java.io.IOException
- An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
-
-