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
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
FieldsModifier and TypeFieldDescriptionprotected char[]
The buffer used for numbers.protected int
The buffer size.protected FragmentIdentifierHandler
The FragmentIdentifierHandler.Fields inherited from class org.apache.batik.parser.AbstractParser
BUNDLE_CLASSNAME, current, errorHandler, localizableSupport, reader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds the current character to the buffer.protected void
doParse()
Parses the current reader.protected String
Returns the content of the buffer.Returns the points handler in use.protected void
Parses an identifier.protected void
Parses a matrix transform.protected void
Parses a PreserveAspectRatio attribute.protected void
Parses a rotate transform.protected void
Parses a scale transform.protected void
Parses a skew transform.protected void
Parses a translate transform.protected void
Parses the svgView attributes.void
Allows an application to register a fragment identifier handler.protected void
Skips the whitespaces and an optional comma.protected void
Skips characters in the given reader until a white space is encountered.protected void
Skips the whitespaces in the current reader.protected void
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 Details
-
buffer
protected char[] bufferThe buffer used for numbers. -
bufferSize
protected int bufferSizeThe buffer size. -
fragmentIdentifierHandler
The FragmentIdentifierHandler.
-
-
Constructor Details
-
FragmentIdentifierParser
public FragmentIdentifierParser()Creates a new FragmentIdentifier parser.
-
-
Method Details
-
setFragmentIdentifierHandler
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
Returns the points handler in use. -
doParse
Parses the current reader.- Specified by:
doParse
in classAbstractParser
- Throws:
ParseException
IOException
-
parseViewAttributes
Parses the svgView attributes.- Throws:
ParseException
IOException
-
parseIdentifier
Parses an identifier.- Throws:
ParseException
IOException
-
getBufferContent
Returns the content of the buffer. -
bufferize
protected void bufferize()Adds the current character to the buffer. If necessary, the buffer grows. -
skipSpaces
Skips the whitespaces in the current reader.- Overrides:
skipSpaces
in classAbstractParser
- Throws:
IOException
-
skipCommaSpaces
Skips the whitespaces and an optional comma.- Overrides:
skipCommaSpaces
in classAbstractParser
- Throws:
IOException
-
parseMatrix
Parses a matrix transform. 'm' is assumed to be the current character.- Throws:
ParseException
IOException
-
parseRotate
Parses a rotate transform. 'r' is assumed to be the current character.- Throws:
ParseException
IOException
-
parseTranslate
Parses a translate transform. 't' is assumed to be the current character.- Throws:
ParseException
IOException
-
parseScale
Parses a scale transform. 'c' is assumed to be the current character.- Throws:
ParseException
IOException
-
parseSkew
Parses a skew transform. 'e' is assumed to be the current character.- Throws:
ParseException
IOException
-
skipTransform
Skips characters in the given reader until a ')' is encountered.- Throws:
IOException
-
parsePreserveAspectRatio
Parses a PreserveAspectRatio attribute.- Throws:
ParseException
IOException
-
skipIdentifier
Skips characters in the given reader until a white space is encountered.- Throws:
IOException
-