org.apache.batik.refimpl.parser
Class ConcreteLengthParser

java.lang.Object
  |
  +--org.apache.batik.refimpl.parser.AbstractParser
        |
        +--org.apache.batik.refimpl.parser.NumberParser
              |
              +--org.apache.batik.refimpl.parser.ConcreteLengthParser
All Implemented Interfaces:
LengthParser, Localizable, Parser
Direct Known Subclasses:
ConcreteLengthListParser

public class ConcreteLengthParser
extends NumberParser
implements LengthParser

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


Field Summary
protected  boolean eRead
          Whether the last character was a 'e' or 'E'.
protected  LengthHandler lengthHandler
          The length 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
ConcreteLengthParser()
          Creates a new LengthParser.
 
Method Summary
 LengthHandler getLengthHandler()
          Returns the length handler in use.
 void parse(java.io.Reader r)
          Parses the given reader.
protected  void parseLength()
          Parses a length value.
protected  void readNumber()
          Implements NumberParser.readNumber().
 void setLengthHandler(LengthHandler handler)
          Allows an application to register a length handler.
 
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

lengthHandler

protected LengthHandler lengthHandler
The length handler used to report parse events.

eRead

protected boolean eRead
Whether the last character was a 'e' or 'E'.
Constructor Detail

ConcreteLengthParser

public ConcreteLengthParser()
Creates a new LengthParser.
Method Detail

setLengthHandler

public void setLengthHandler(LengthHandler handler)
Allows an application to register a length 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:
setLengthHandler in interface LengthParser
Parameters:
handler - The transform list handler.

getLengthHandler

public LengthHandler getLengthHandler()
Returns the length handler in use.
Specified by:
getLengthHandler in interface LengthParser

parse

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

parseLength

protected void parseLength()
                    throws ParseException,
                           java.lang.NumberFormatException
Parses a length value.

readNumber

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


Copyright © 2000 Apache Software Foundation. All Rights Reserved.