java.lang.Object
io.sf.carte.echosvg.parser.AbstractParser
io.sf.carte.echosvg.parser.NumberParser
io.sf.carte.echosvg.parser.PointsParser
- All Implemented Interfaces:
Localizable,Parser
This class implements an event-based parser for the SVG points attribute
values (used with polyline and polygon elements).
Original author: Stephane Hillion. For later modifications, see Git history.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether the last character was a 'e' or 'E'.Fields inherited from class io.sf.carte.echosvg.parser.AbstractParser
BUNDLE_CLASSNAME, current, errorHandler, localizableSupport, reader -
Constructor Summary
ConstructorsConstructorDescriptionPointsParser(PointsHandler handler) Creates a new PointsParser with the given handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoParse()Parses the current stream.Returns the points handler in use.protected voidhandleNumber(short unitType, float floatValue) voidsetPointsHandler(PointsHandler handler) Allows an application to register a points handler.Methods inherited from class io.sf.carte.echosvg.parser.NumberParser
buildFloat, parseFloatMethods inherited from class io.sf.carte.echosvg.parser.AbstractParser
createErrorMessage, formatMessage, getBundleClassName, getCurrent, getLocale, getPreferredUnit, handleCalc, handleIdent, handleListEnd, handleListStart, handleMathExpression, handleMathFunction, parse, parse, parse, reportCharacterExpectedError, reportError, reportUnexpectedCharacterError, setErrorHandler, setLocale, skipCommaSpaces, skipSpaces
-
Field Details
-
eRead
protected boolean eReadWhether the last character was a 'e' or 'E'.
-
-
Constructor Details
-
PointsParser
Creates a new PointsParser with the given handler.- Parameters:
handler- The transform list handler.
-
-
Method Details
-
setPointsHandler
Allows an application to register a points 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.
-
getPointsHandler
Returns the points handler in use. -
doParse
Parses the current stream.- Specified by:
doParsein classAbstractParser- Throws:
ParseExceptionIOException
-
handleNumber
- Overrides:
handleNumberin classAbstractParser- Throws:
ParseException
-