Class 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 Detail

      • buffer

        protected char[] buffer
        The buffer used for numbers.
      • bufferSize

        protected int bufferSize
        The buffer size.
    • Constructor Detail

      • FragmentIdentifierParser

        public FragmentIdentifierParser()
        Creates a new FragmentIdentifier parser.
    • 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.
      • parseViewAttributes

        protected void parseViewAttributes()
                                    throws ParseException,
                                           java.io.IOException
        Parses the svgView attributes.
        Throws:
        ParseException
        java.io.IOException
      • parseIdentifier

        protected void parseIdentifier()
                                throws ParseException,
                                       java.io.IOException
        Parses an identifier.
        Throws:
        ParseException
        java.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.IOException
        Skips the whitespaces in the current reader.
        Overrides:
        skipSpaces in class AbstractParser
        Throws:
        java.io.IOException
      • skipCommaSpaces

        protected void skipCommaSpaces()
                                throws java.io.IOException
        Skips the whitespaces and an optional comma.
        Overrides:
        skipCommaSpaces in class AbstractParser
        Throws:
        java.io.IOException
      • parseMatrix

        protected void parseMatrix()
                            throws ParseException,
                                   java.io.IOException
        Parses a matrix transform. 'm' is assumed to be the current character.
        Throws:
        ParseException
        java.io.IOException
      • parseRotate

        protected void parseRotate()
                            throws ParseException,
                                   java.io.IOException
        Parses a rotate transform. 'r' is assumed to be the current character.
        Throws:
        ParseException
        java.io.IOException
      • parseTranslate

        protected void parseTranslate()
                               throws ParseException,
                                      java.io.IOException
        Parses a translate transform. 't' is assumed to be the current character.
        Throws:
        ParseException
        java.io.IOException
      • parseScale

        protected void parseScale()
                           throws ParseException,
                                  java.io.IOException
        Parses a scale transform. 'c' is assumed to be the current character.
        Throws:
        ParseException
        java.io.IOException
      • parseSkew

        protected void parseSkew()
                          throws ParseException,
                                 java.io.IOException
        Parses a skew transform. 'e' is assumed to be the current character.
        Throws:
        ParseException
        java.io.IOException
      • skipTransform

        protected void skipTransform()
                              throws java.io.IOException
        Skips characters in the given reader until a ')' is encountered.
        Throws:
        java.io.IOException
      • parsePreserveAspectRatio

        protected void parsePreserveAspectRatio()
                                         throws ParseException,
                                                java.io.IOException
        Parses a PreserveAspectRatio attribute.
        Throws:
        ParseException
        java.io.IOException
      • skipIdentifier

        protected void skipIdentifier()
                               throws java.io.IOException
        Skips characters in the given reader until a white space is encountered.
        Throws:
        java.io.IOException