org.apache.batik.refimpl.parser
Class ConcreteTransformListParser

java.lang.Object
  |
  +--org.apache.batik.refimpl.parser.AbstractParser
        |
        +--org.apache.batik.refimpl.parser.NumberParser
              |
              +--org.apache.batik.refimpl.parser.ConcreteTransformListParser
All Implemented Interfaces:
Localizable, Parser, TransformListParser

public class ConcreteTransformListParser
extends NumberParser
implements TransformListParser

This class implements an event-based parser for the SVG transform attribute values.


Field Summary
protected  TransformListHandler transformListHandler
          The transform list handler used to report parse events.
 
Fields inherited from class org.apache.batik.refimpl.parser.NumberParser
buffer, bufferSize
 
Fields inherited from class org.apache.batik.refimpl.parser.AbstractParser
BUNDLE_CLASSNAME, column, current, errorHandler, line, localizableSupport, newlineRead, reader
 
Constructor Summary
ConcreteTransformListParser()
          Creates a new TransformListParser.
 
Method Summary
 TransformListHandler getTransformListHandler()
          Returns the transform list handler in use.
 void parse(java.io.Reader r)
          Parses the given reader.
protected  void parseMatrix()
          Parses a matrix transform.
protected  void parseRotate()
          Parses a rotate transform.
protected  void parseScale()
          Parses a scale transform.
protected  void parseSkew()
          Parses a skew transform.
protected  void parseTranslate()
          Parses a translate transform.
protected  void readNumber()
          Implements NumberParser.readNumber().
 void setTransformListHandler(TransformListHandler handler)
          Allows an application to register a transform list handler.
protected  void skipTransform()
          Skips characters in the given reader until a ')' is encountered.
 
Methods inherited from class org.apache.batik.refimpl.parser.NumberParser
bufferize, getBufferContent, parseFloat
 
Methods inherited from class org.apache.batik.refimpl.parser.AbstractParser
createErrorMessage, formatMessage, getBundleClassName, getCurrent, getLocale, initialize, read, reportError, setErrorHandler, setLocale, skipCommaSpaces, skipSpaces
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.batik.parser.Parser
setErrorHandler
 
Methods inherited from interface org.apache.batik.i18n.Localizable
formatMessage, getLocale, setLocale
 

Field Detail

transformListHandler

protected TransformListHandler transformListHandler
The transform list handler used to report parse events.
Constructor Detail

ConcreteTransformListParser

public ConcreteTransformListParser()
Creates a new TransformListParser.
Method Detail

setTransformListHandler

public void setTransformListHandler(TransformListHandler handler)
Allows an application to register a transform list handler.

If the application does not register a handler, all events reported by the parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the parser must begin using the new handler immediately.

Specified by:
setTransformListHandler in interface TransformListParser
Parameters:
handler - The transform handler.

getTransformListHandler

public TransformListHandler getTransformListHandler()
Returns the transform list handler in use.
Specified by:
getTransformListHandler in interface TransformListParser

parse

public void parse(java.io.Reader r)
           throws ParseException
Parses the given reader.
Specified by:
parse in interface Parser

parseMatrix

protected void parseMatrix()
                    throws ParseException
Parses a matrix transform. 'm' is assumed to be the current character.

parseRotate

protected void parseRotate()
                    throws ParseException
Parses a rotate transform. 'r' is assumed to be the current character.
Returns:
the current character.

parseTranslate

protected void parseTranslate()
                       throws ParseException
Parses a translate transform. 't' is assumed to be the current character.
Returns:
the current character.

parseScale

protected void parseScale()
                   throws ParseException
Parses a scale transform. 'c' is assumed to be the current character.
Returns:
the current character.

parseSkew

protected void parseSkew()
                  throws ParseException
Parses a skew transform. 'e' is assumed to be the current character.
Returns:
the current character.

skipTransform

protected void skipTransform()
Skips characters in the given reader until a ')' is encountered.
Returns:
the first character after the ')'.

readNumber

protected void readNumber()
                   throws ParseException
Implements NumberParser.readNumber().
Overrides:
readNumber in class NumberParser


Copyright © 2000 Apache Software Foundation. All Rights Reserved.