Package org.apache.batik.parser
Class FragmentIdentifierParser
- java.lang.Object
-
- org.apache.batik.parser.AbstractParser
-
- org.apache.batik.parser.NumberParser
-
- org.apache.batik.parser.FragmentIdentifierParser
-
- All Implemented Interfaces:
Localizable,Parser
public class FragmentIdentifierParser extends NumberParser
This class represents an event-based parser for the SVG fragment identifiers.- Version:
- $Id: FragmentIdentifierParser.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description protected char[]bufferThe buffer used for numbers.protected intbufferSizeThe buffer size.protected FragmentIdentifierHandlerfragmentIdentifierHandlerThe FragmentIdentifierHandler.-
Fields inherited from class org.apache.batik.parser.AbstractParser
BUNDLE_CLASSNAME, current, errorHandler, localizableSupport, reader
-
-
Constructor Summary
Constructors Constructor Description FragmentIdentifierParser()Creates a new FragmentIdentifier parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbufferize()Adds the current character to the buffer.protected voiddoParse()Parses the current reader.protected java.lang.StringgetBufferContent()Returns the content of the buffer.FragmentIdentifierHandlergetFragmentIdentifierHandler()Returns the points handler in use.protected voidparseIdentifier()Parses an identifier.protected voidparseMatrix()Parses a matrix transform.protected voidparsePreserveAspectRatio()Parses a PreserveAspectRatio attribute.protected voidparseRotate()Parses a rotate transform.protected voidparseScale()Parses a scale transform.protected voidparseSkew()Parses a skew transform.protected voidparseTranslate()Parses a translate transform.protected voidparseViewAttributes()Parses the svgView attributes.voidsetFragmentIdentifierHandler(FragmentIdentifierHandler handler)Allows an application to register a fragment identifier handler.protected voidskipCommaSpaces()Skips the whitespaces and an optional comma.protected voidskipIdentifier()Skips characters in the given reader until a white space is encountered.protected voidskipSpaces()Skips the whitespaces in the current reader.protected voidskipTransform()Skips characters in the given reader until a ')' is encountered.-
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
-
-
-
-
Field Detail
-
buffer
protected char[] buffer
The buffer used for numbers.
-
bufferSize
protected int bufferSize
The buffer size.
-
fragmentIdentifierHandler
protected FragmentIdentifierHandler fragmentIdentifierHandler
The FragmentIdentifierHandler.
-
-
Method Detail
-
setFragmentIdentifierHandler
public void setFragmentIdentifierHandler(FragmentIdentifierHandler handler)
Allows an application to register a fragment identifier 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.
-
getFragmentIdentifierHandler
public FragmentIdentifierHandler getFragmentIdentifierHandler()
Returns the points handler in use.
-
doParse
protected void doParse() throws ParseException, java.io.IOExceptionParses the current reader.- Specified by:
doParsein classAbstractParser- Throws:
ParseExceptionjava.io.IOException
-
parseViewAttributes
protected void parseViewAttributes() throws ParseException, java.io.IOExceptionParses the svgView attributes.- Throws:
ParseExceptionjava.io.IOException
-
parseIdentifier
protected void parseIdentifier() throws ParseException, java.io.IOExceptionParses an identifier.- Throws:
ParseExceptionjava.io.IOException
-
getBufferContent
protected java.lang.String getBufferContent()
Returns the content of the buffer.
-
bufferize
protected void bufferize()
Adds the current character to the buffer. If necessary, the buffer grows.
-
skipSpaces
protected void skipSpaces() throws java.io.IOExceptionSkips the whitespaces in the current reader.- Overrides:
skipSpacesin classAbstractParser- Throws:
java.io.IOException
-
skipCommaSpaces
protected void skipCommaSpaces() throws java.io.IOExceptionSkips the whitespaces and an optional comma.- Overrides:
skipCommaSpacesin classAbstractParser- Throws:
java.io.IOException
-
parseMatrix
protected void parseMatrix() throws ParseException, java.io.IOExceptionParses a matrix transform. 'm' is assumed to be the current character.- Throws:
ParseExceptionjava.io.IOException
-
parseRotate
protected void parseRotate() throws ParseException, java.io.IOExceptionParses a rotate transform. 'r' is assumed to be the current character.- Throws:
ParseExceptionjava.io.IOException
-
parseTranslate
protected void parseTranslate() throws ParseException, java.io.IOExceptionParses a translate transform. 't' is assumed to be the current character.- Throws:
ParseExceptionjava.io.IOException
-
parseScale
protected void parseScale() throws ParseException, java.io.IOExceptionParses a scale transform. 'c' is assumed to be the current character.- Throws:
ParseExceptionjava.io.IOException
-
parseSkew
protected void parseSkew() throws ParseException, java.io.IOExceptionParses a skew transform. 'e' is assumed to be the current character.- Throws:
ParseExceptionjava.io.IOException
-
skipTransform
protected void skipTransform() throws java.io.IOExceptionSkips characters in the given reader until a ')' is encountered.- Throws:
java.io.IOException
-
parsePreserveAspectRatio
protected void parsePreserveAspectRatio() throws ParseException, java.io.IOExceptionParses a PreserveAspectRatio attribute.- Throws:
ParseExceptionjava.io.IOException
-
skipIdentifier
protected void skipIdentifier() throws java.io.IOExceptionSkips characters in the given reader until a white space is encountered.- Throws:
java.io.IOException
-
-