org.apache.batik.parser

Class FragmentIdentifierParser

public class FragmentIdentifierParser extends NumberParser

This class represents an event-based parser for the SVG fragment identifiers.
Field Summary
protected char[]buffer
The buffer used for numbers.
protected intbufferSize
The buffer size.
protected FragmentIdentifierHandlerfragmentIdentifierHandler
The FragmentIdentifierHandler.
Constructor Summary
FragmentIdentifierParser()
Creates a new FragmentIdentifier parser.
Method Summary
protected voidbufferize()
Adds the current character to the buffer.
protected voiddoParse()
Parses the current reader.
protected 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.

Field Detail

buffer

protected char[] buffer
The buffer used for numbers.

bufferSize

protected int bufferSize
The buffer size.

fragmentIdentifierHandler

protected FragmentIdentifierHandler fragmentIdentifierHandler
The FragmentIdentifierHandler.

Constructor Detail

FragmentIdentifierParser

public FragmentIdentifierParser()
Creates a new FragmentIdentifier parser.

Method Detail

bufferize

protected void bufferize()
Adds the current character to the buffer. If necessary, the buffer grows.

doParse

protected void doParse()
Parses the current reader.

getBufferContent

protected String getBufferContent()
Returns the content of the buffer.

getFragmentIdentifierHandler

public FragmentIdentifierHandler getFragmentIdentifierHandler()
Returns the points handler in use.

parseIdentifier

protected void parseIdentifier()
Parses an identifier.

parseMatrix

protected void parseMatrix()
Parses a matrix transform. 'm' is assumed to be the current character.

parsePreserveAspectRatio

protected void parsePreserveAspectRatio()
Parses a PreserveAspectRatio attribute.

parseRotate

protected void parseRotate()
Parses a rotate transform. 'r' is assumed to be the current character.

parseScale

protected void parseScale()
Parses a scale transform. 'c' is assumed to be the current character.

parseSkew

protected void parseSkew()
Parses a skew transform. 'e' is assumed to be the current character.

parseTranslate

protected void parseTranslate()
Parses a translate transform. 't' is assumed to be the current character.

parseViewAttributes

protected void parseViewAttributes()
Parses the svgView attributes.

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.

skipCommaSpaces

protected void skipCommaSpaces()
Skips the whitespaces and an optional comma.

skipIdentifier

protected void skipIdentifier()
Skips characters in the given reader until a white space is encountered.

skipSpaces

protected void skipSpaces()
Skips the whitespaces in the current reader.

skipTransform

protected void skipTransform()
Skips characters in the given reader until a ')' is encountered.
Copyright B) 2008 Apache Software Foundation. All Rights Reserved.