|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.batik.css.CSSDocumentHandler
This class provides conveniant methods for parsing style sheets and
implements the DocumentHandler
interface.
Field Summary | |
protected boolean |
append
Whether the parsed rules must be added to the style sheet. |
protected CSSRule |
currentRule
The current rule. |
protected ValueFactoryMap |
factories
The value factory map. |
protected Parser |
parser
The CSS parser. |
protected static java.lang.Class |
parserClass
The parser class. |
protected CSSOMStyleSheet |
styleSheet
The style sheet. |
protected java.lang.String |
uri
The URI of the current document. |
Constructor Summary | |
protected |
CSSDocumentHandler(CSSOMStyleSheet ss,
java.lang.String uri,
boolean append)
Creates a new handler. |
protected |
CSSDocumentHandler(CSSOMStyleSheet ss,
java.lang.String uri,
CSSRule cr,
boolean append)
Creates a new handler. |
Method Summary | |
void |
comment(java.lang.String text)
SAC: Implements DocumentHandler.comment(String) . |
static Parser |
createParser()
Creates a new parser. |
void |
endDocument(InputSource source)
SAC: Implements DocumentHandler.endDocument(InputSource) . |
void |
endFontFace()
SAC: Implements DocumentHandler.endFontFace() . |
void |
endMedia(SACMediaList media)
SAC: Implements DocumentHandler.endMedia(SACMediaList) . |
void |
endPage(java.lang.String name,
java.lang.String pseudo_page)
SAC: Implements DocumentHandler.endPage(String,String) . |
void |
endSelector(SelectorList selectors)
SAC: Implements DocumentHandler.endSelector(SelectorList) . |
void |
ignorableAtRule(java.lang.String atRule)
SAC: Implements DocumentHandler.ignorableAtRule(String) . |
void |
importStyle(java.lang.String uri,
SACMediaList media,
java.lang.String defaultNamespaceURI)
SAC: Implements DocumentHandler.importStyle(String,SACMediaList,String) . |
void |
namespaceDeclaration(java.lang.String prefix,
java.lang.String uri)
SAC: Implements DocumentHandler.namespaceDeclaration(String,String) . |
static CSSRule |
parseRule(CSSOMStyleSheet ss,
java.lang.String rule)
Parses one rules from its CSS text. |
static void |
parseRules(CSSOMStyleSheet ss,
java.lang.String rules)
Parses a set of rules from its CSS text. |
static void |
parseStyleSheet(CSSOMStyleSheet ss,
java.lang.String uri)
Parses a style sheet. |
void |
property(java.lang.String name,
LexicalUnit value,
boolean important)
SAC: Implements DocumentHandler.property(String,LexicalUnit,boolean) . |
static void |
setParserClassName(java.lang.String name)
Sets the parser class name. |
void |
startDocument(InputSource source)
SAC: Implements DocumentHandler.startDocument(InputSource) . |
void |
startFontFace()
SAC: Implements DocumentHandler.startFontFace() . |
void |
startMedia(SACMediaList media)
SAC: Implements DocumentHandler.startMedia(SACMediaList) . |
void |
startPage(java.lang.String name,
java.lang.String pseudo_page)
SAC: Implements DocumentHandler.startPage(String,String) . |
void |
startSelector(SelectorList selectors)
SAC: Implements DocumentHandler.startSelector(SelectorList) . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.lang.Class parserClass
protected Parser parser
protected ValueFactoryMap factories
protected CSSRule currentRule
protected CSSOMStyleSheet styleSheet
protected boolean append
protected java.lang.String uri
Constructor Detail |
protected CSSDocumentHandler(CSSOMStyleSheet ss, java.lang.String uri, boolean append)
protected CSSDocumentHandler(CSSOMStyleSheet ss, java.lang.String uri, CSSRule cr, boolean append)
Method Detail |
public static void setParserClassName(java.lang.String name)
public static Parser createParser()
public static void parseStyleSheet(CSSOMStyleSheet ss, java.lang.String uri) throws DOMException
public static void parseRules(CSSOMStyleSheet ss, java.lang.String rules) throws DOMException
public static CSSRule parseRule(CSSOMStyleSheet ss, java.lang.String rule) throws DOMException
public void startDocument(InputSource source) throws CSSException
DocumentHandler.startDocument(InputSource)
.startDocument
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
uri
- The URI of the style sheet. @@TODO can be NULL ! (inline style sheet)CSSException
- Any CSS exception, possibly wrapping another
exception.public void endDocument(InputSource source) throws CSSException
DocumentHandler.endDocument(InputSource)
.endDocument
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
uri
- The URI of the style sheet.CSSException
- Any CSS exception, possibly wrapping another
exception.public void comment(java.lang.String text) throws CSSException
DocumentHandler.comment(String)
.comment
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
text
- The comment.CSSException
- Any CSS exception, possibly wrapping another
exception.public void ignorableAtRule(java.lang.String atRule) throws CSSException
DocumentHandler.ignorableAtRule(String)
.ignorableAtRule
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
at-rule
- The complete ignored at-rule.CSSException
- Any CSS exception, possibly wrapping another
exception.public void namespaceDeclaration(java.lang.String prefix, java.lang.String uri) throws CSSException
DocumentHandler.namespaceDeclaration(String,String)
.namespaceDeclaration
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
prefix
- null
if this is the default namespaceuri
- The URI for this namespace.CSSException
- Any CSS exception, possibly wrapping another
exception.public void importStyle(java.lang.String uri, SACMediaList media, java.lang.String defaultNamespaceURI) throws CSSException
DocumentHandler.importStyle(String,SACMediaList,String)
.importStyle
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
uri
- The URI of the imported style sheet.media
- The intended destination media for style information.defaultNamepaceURI
- The default namespace URI for the imported
style sheet.CSSException
- Any CSS exception, possibly wrapping another
exception.public void startMedia(SACMediaList media) throws CSSException
DocumentHandler.startMedia(SACMediaList)
.startMedia
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
media
- The intended destination media for style information.CSSException
- Any CSS exception, possibly wrapping another
exception.public void endMedia(SACMediaList media) throws CSSException
DocumentHandler.endMedia(SACMediaList)
.endMedia
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
media
- The intended destination media for style information.CSSException
- Any CSS exception, possibly wrapping another
exception.public void startPage(java.lang.String name, java.lang.String pseudo_page) throws CSSException
DocumentHandler.startPage(String,String)
.startPage
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
name
- the name of the page (if any, null otherwise)pseudo_page
- the pseudo page (if any, null otherwise)CSSException
- Any CSS exception, possibly wrapping another
exception.public void endPage(java.lang.String name, java.lang.String pseudo_page) throws CSSException
DocumentHandler.endPage(String,String)
.endPage
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
media
- The intended destination medium for style information.pseudo_page
- the pseudo page (if any, null otherwise)CSSException
- Any CSS exception, possibly wrapping another
exception.public void startFontFace() throws CSSException
DocumentHandler.startFontFace()
.startFontFace
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
CSSException
- Any CSS exception, possibly wrapping another
exception.public void endFontFace() throws CSSException
DocumentHandler.endFontFace()
.endFontFace
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
CSSException
- Any CSS exception, possibly wrapping another
exception.public void startSelector(SelectorList selectors) throws CSSException
DocumentHandler.startSelector(SelectorList)
.startSelector
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
selectors
- All intended selectors for all declarations.CSSException
- Any CSS exception, possibly wrapping another
exception.public void endSelector(SelectorList selectors) throws CSSException
DocumentHandler.endSelector(SelectorList)
.endSelector
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
selectors
- All intended selectors for all declarations.CSSException
- Any CSS exception, possibly wrapping another
exception.public void property(java.lang.String name, LexicalUnit value, boolean important) throws CSSException
DocumentHandler.property(String,LexicalUnit,boolean)
.property
in interface DocumentHandler
org.w3c.css.sac.DocumentHandler
name
- the name of the property.value
- the value of the property. All whitespace are stripped.important
- is this property important ?CSSException
- Any CSS exception, possibly wrapping another
exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |