org.apache.batik.parser.style
Class StyleAttributeParser

java.lang.Object
  |
  +--org.apache.batik.parser.style.StyleAttributeParser
All Implemented Interfaces:
Localizable
Direct Known Subclasses:
DefaultStyleAttributeParser

public class StyleAttributeParser
extends java.lang.Object
implements Localizable

This class represents a parser for SVG style attributes.


Field Summary
static java.lang.String BUNDLE_CLASSNAME
          The resources bundle classname.
protected  ErrorHandler errorHandler
          The ErrorHandler.
protected  java.util.Map factories
          The value factories.
protected  Parser parser
          The underlying CSS parser.
 
Constructor Summary
StyleAttributeParser(java.lang.String s)
          Creates a new StyleAttributeParser object.
 
Method Summary
 java.lang.String formatMessage(java.lang.String key, java.lang.Object[] args)
          Implements Localizable.formatMessage(String,Object[]).
 ErrorHandler getErrorHandler()
          Gets the ErrorHandler.
 java.util.Locale getLocale()
          Implements Localizable.getLocale().
 CSSValue parse(java.io.Reader r, java.lang.String ns, java.lang.String ln)
          Parses the given reader and returns the CSSValue object corresponding to the attribute with the given namespaceURI and localName.
 void putCSSValueFactory(java.lang.String ns, java.lang.String ln, CSSValueFactory vf)
          Allows the user to register its own ValueFactory to create a style attribute value.
 void removeCSSValueFactory(java.lang.String ns, java.lang.String ln)
          Allows the user to unregister a CSSValueFactory.
 void setErrorHandler(ErrorHandler e)
          Sets the ErrorHandler.
 void setLocale(java.util.Locale l)
          Implements Localizable.setLocale(Locale).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUNDLE_CLASSNAME

public static final java.lang.String BUNDLE_CLASSNAME
The resources bundle classname.

parser

protected Parser parser
The underlying CSS parser.

errorHandler

protected ErrorHandler errorHandler
The ErrorHandler.

factories

protected java.util.Map factories
The value factories.
Constructor Detail

StyleAttributeParser

public StyleAttributeParser(java.lang.String s)
                     throws ParseException
Creates a new StyleAttributeParser object.
Parameters:
s - The name of a SAC compliant CSS parser class.
Method Detail

setLocale

public void setLocale(java.util.Locale l)
Implements Localizable.setLocale(Locale).
Specified by:
setLocale in interface Localizable
Following copied from interface: org.apache.batik.i18n.Localizable
Parameters:
l - The locale to set.

getLocale

public java.util.Locale getLocale()
Implements Localizable.getLocale().
Specified by:
getLocale in interface Localizable

formatMessage

public java.lang.String formatMessage(java.lang.String key,
                                      java.lang.Object[] args)
Implements Localizable.formatMessage(String,Object[]).
Specified by:
formatMessage in interface Localizable
Following copied from interface: org.apache.batik.i18n.Localizable
Parameters:
key - The key used to retreive the message from the resource bundle.
args - The objects that compose the message.
Throws:
java.util.MissingResourceException - if the key is not in the bundle.

parse

public CSSValue parse(java.io.Reader r,
                      java.lang.String ns,
                      java.lang.String ln)
               throws ParseException
Parses the given reader and returns the CSSValue object corresponding to the attribute with the given namespaceURI and localName.
Parameters:
ns - The namespace URI of the attribute to parse.
ln - The local name of the attribute to parse.

setErrorHandler

public void setErrorHandler(ErrorHandler e)
Sets the ErrorHandler.

getErrorHandler

public ErrorHandler getErrorHandler()
Gets the ErrorHandler.

putCSSValueFactory

public void putCSSValueFactory(java.lang.String ns,
                               java.lang.String ln,
                               CSSValueFactory vf)
Allows the user to register its own ValueFactory to create a style attribute value.
Parameters:
ns - The namespace URI of the attribute associated with the given factory.
ln - The local name of the attribute associated with the given factory.

removeCSSValueFactory

public void removeCSSValueFactory(java.lang.String ns,
                                  java.lang.String ln)
Allows the user to unregister a CSSValueFactory.
Parameters:
ns - The namespace URI of the attribute associated with the factory to remove.
ln - The local name of the attribute associated with the factory to remove.


Copyright © 2001 Apache Software Foundation. All Rights Reserved.