Package org.apache.batik.parser
Class PathParser
- java.lang.Object
-
- org.apache.batik.parser.AbstractParser
-
- org.apache.batik.parser.NumberParser
-
- org.apache.batik.parser.PathParser
-
- All Implemented Interfaces:
Localizable,Parser
public class PathParser extends NumberParser
This class implements an event-based parser for the SVG path's d attribute values.- Version:
- $Id: PathParser.java 1802297 2017-07-18 13:58:12Z ssteiner $
-
-
Field Summary
Fields Modifier and Type Field Description protected PathHandlerpathHandlerThe path handler used to report parse events.-
Fields inherited from class org.apache.batik.parser.AbstractParser
BUNDLE_CLASSNAME, current, errorHandler, localizableSupport, reader
-
-
Constructor Summary
Constructors Constructor Description PathParser()Creates a new PathParser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_parsel(boolean expectNumber)protected void_parseL(boolean expectNumber)protected voiddoParse()Method responsible for actually parsing data after AbstractParser has initialized itself.PathHandlergetPathHandler()Returns the path handler in use.protected voidparsea()Parses a 'a' command.protected voidparseA()Parses a 'A' command.protected voidparsec()Parses a 'c' command.protected voidparseC()Parses a 'C' command.protected voidparseh()Parses a 'h' command.protected voidparseH()Parses a 'H' command.protected voidparsel()Parses a 'l' command.protected voidparseL()Parses a 'L' command.protected voidparsem()Parses a 'm' command.protected voidparseM()Parses a 'M' command.protected voidparseq()Parses a 'q' command.protected voidparseQ()Parses a 'Q' command.protected voidparses()Parses a 's' command.protected voidparseS()Parses a 'S' command.protected voidparset()Parses a 't' command.protected voidparseT()Parses a 'T' command.protected voidparsev()Parses a 'v' command.protected voidparseV()Parses a 'V' command.protected voidreportUnexpected(int ch)voidsetPathHandler(PathHandler handler)Allows an application to register a path handler.protected booleanskipCommaSpaces2()Skips the whitespaces and an optional comma.protected voidskipSubPath()Skips a sub-path.-
Methods inherited from class org.apache.batik.parser.NumberParser
buildFloat, parseFloat
-
Methods inherited from class org.apache.batik.parser.AbstractParser
createErrorMessage, formatMessage, getBundleClassName, getCurrent, getLocale, parse, parse, parse, reportCharacterExpectedError, reportError, reportUnexpectedCharacterError, setErrorHandler, setLocale, skipCommaSpaces, skipSpaces
-
-
-
-
Field Detail
-
pathHandler
protected PathHandler pathHandler
The path handler used to report parse events.
-
-
Method Detail
-
setPathHandler
public void setPathHandler(PathHandler handler)
Allows an application to register a path 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.
- Parameters:
handler- The transform list handler.
-
getPathHandler
public PathHandler getPathHandler()
Returns the path handler in use.
-
doParse
protected void doParse() throws ParseException, java.io.IOExceptionDescription copied from class:AbstractParserMethod responsible for actually parsing data after AbstractParser has initialized itself.- Specified by:
doParsein classAbstractParser- Throws:
ParseExceptionjava.io.IOException
-
parsem
protected void parsem() throws ParseException, java.io.IOExceptionParses a 'm' command.- Throws:
ParseExceptionjava.io.IOException
-
parseM
protected void parseM() throws ParseException, java.io.IOExceptionParses a 'M' command.- Throws:
ParseExceptionjava.io.IOException
-
parsel
protected void parsel() throws ParseException, java.io.IOExceptionParses a 'l' command.- Throws:
ParseExceptionjava.io.IOException
-
_parsel
protected void _parsel(boolean expectNumber) throws ParseException, java.io.IOException- Throws:
ParseExceptionjava.io.IOException
-
parseL
protected void parseL() throws ParseException, java.io.IOExceptionParses a 'L' command.- Throws:
ParseExceptionjava.io.IOException
-
_parseL
protected void _parseL(boolean expectNumber) throws ParseException, java.io.IOException- Throws:
ParseExceptionjava.io.IOException
-
parseh
protected void parseh() throws ParseException, java.io.IOExceptionParses a 'h' command.- Throws:
ParseExceptionjava.io.IOException
-
parseH
protected void parseH() throws ParseException, java.io.IOExceptionParses a 'H' command.- Throws:
ParseExceptionjava.io.IOException
-
parsev
protected void parsev() throws ParseException, java.io.IOExceptionParses a 'v' command.- Throws:
ParseExceptionjava.io.IOException
-
parseV
protected void parseV() throws ParseException, java.io.IOExceptionParses a 'V' command.- Throws:
ParseExceptionjava.io.IOException
-
parsec
protected void parsec() throws ParseException, java.io.IOExceptionParses a 'c' command.- Throws:
ParseExceptionjava.io.IOException
-
parseC
protected void parseC() throws ParseException, java.io.IOExceptionParses a 'C' command.- Throws:
ParseExceptionjava.io.IOException
-
parseq
protected void parseq() throws ParseException, java.io.IOExceptionParses a 'q' command.- Throws:
ParseExceptionjava.io.IOException
-
parseQ
protected void parseQ() throws ParseException, java.io.IOExceptionParses a 'Q' command.- Throws:
ParseExceptionjava.io.IOException
-
parses
protected void parses() throws ParseException, java.io.IOExceptionParses a 's' command.- Throws:
ParseExceptionjava.io.IOException
-
parseS
protected void parseS() throws ParseException, java.io.IOExceptionParses a 'S' command.- Throws:
ParseExceptionjava.io.IOException
-
parset
protected void parset() throws ParseException, java.io.IOExceptionParses a 't' command.- Throws:
ParseExceptionjava.io.IOException
-
parseT
protected void parseT() throws ParseException, java.io.IOExceptionParses a 'T' command.- Throws:
ParseExceptionjava.io.IOException
-
parsea
protected void parsea() throws ParseException, java.io.IOExceptionParses a 'a' command.- Throws:
ParseExceptionjava.io.IOException
-
parseA
protected void parseA() throws ParseException, java.io.IOExceptionParses a 'A' command.- Throws:
ParseExceptionjava.io.IOException
-
skipSubPath
protected void skipSubPath() throws ParseException, java.io.IOExceptionSkips a sub-path.- Throws:
ParseExceptionjava.io.IOException
-
reportUnexpected
protected void reportUnexpected(int ch) throws ParseException, java.io.IOException- Throws:
ParseExceptionjava.io.IOException
-
skipCommaSpaces2
protected boolean skipCommaSpaces2() throws java.io.IOExceptionSkips the whitespaces and an optional comma.- Returns:
- true if comma was skipped.
- Throws:
java.io.IOException
-
-