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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected char[]The buffer used for numbers.protected intThe buffer size.protected FragmentIdentifierHandlerThe FragmentIdentifierHandler.Fields inherited from class AbstractParser
BUNDLE_CLASSNAME, current, errorHandler, localizableSupport, reader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds the current character to the buffer.protected voiddoParse()Parses the current reader.protected StringReturns the content of the buffer.Returns the points handler in use.protected voidParses an identifier.protected voidParses a matrix transform.protected voidParses a PreserveAspectRatio attribute.protected voidParses a rotate transform.protected voidParses a scale transform.protected voidParses a skew transform.protected voidParses a translate transform.protected voidParses the svgView attributes.voidAllows an application to register a fragment identifier handler.protected voidSkips the whitespaces and an optional comma.protected voidSkips characters in the given reader until a white space is encountered.protected voidSkips the whitespaces in the current reader.protected voidSkips characters in the given reader until a ')' is encountered.Methods inherited from class NumberParser
buildFloat, parseFloatMethods inherited from class 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:
doParsein classAbstractParser- Throws:
ParseExceptionIOException
-
parseViewAttributes
Parses the svgView attributes.- Throws:
ParseExceptionIOException
-
parseIdentifier
Parses an identifier.- Throws:
ParseExceptionIOException
-
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:
skipSpacesin classAbstractParser- Throws:
IOException
-
skipCommaSpaces
Skips the whitespaces and an optional comma.- Overrides:
skipCommaSpacesin classAbstractParser- Throws:
IOException
-
parseMatrix
Parses a matrix transform. 'm' is assumed to be the current character.- Throws:
ParseExceptionIOException
-
parseRotate
Parses a rotate transform. 'r' is assumed to be the current character.- Throws:
ParseExceptionIOException
-
parseTranslate
Parses a translate transform. 't' is assumed to be the current character.- Throws:
ParseExceptionIOException
-
parseScale
Parses a scale transform. 'c' is assumed to be the current character.- Throws:
ParseExceptionIOException
-
parseSkew
Parses a skew transform. 'e' is assumed to be the current character.- Throws:
ParseExceptionIOException
-
skipTransform
Skips characters in the given reader until a ')' is encountered.- Throws:
IOException
-
parsePreserveAspectRatio
Parses a PreserveAspectRatio attribute.- Throws:
ParseExceptionIOException
-
skipIdentifier
Skips characters in the given reader until a white space is encountered.- Throws:
IOException
-