Class PofParser

  • All Implemented Interfaces:
    PofConstants

    public class PofParser
    extends PofHelper
    implements PofConstants
    A "push" parser (event-based parser) for ripping through a POF stream and delivering the contents as events to a PofHandler object.
    Since:
    Coherence 3.2
    Author:
    cp 2006.07.12
    • Constructor Detail

      • PofParser

        public PofParser​(PofHandler handler)
        Construct a POF parser that will push events to the specified handler.
        Parameters:
        handler - a POF handler object
    • Method Detail

      • parse

        public void parse​(ReadBuffer.BufferInput in)
        Parse a POF value that is in the passed BufferInput.
        Parameters:
        in - the BufferInput to read the POF value from
      • parseValue

        protected void parseValue​(ReadBuffer.BufferInput in,
                                  int iPos)
                           throws IOException
        Within the POF stream, parse a POF value that is in the passed BufferInput.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseUniformValue

        protected void parseUniformValue​(ReadBuffer.BufferInput in,
                                         int iPos,
                                         int nType)
                                  throws IOException
        Within the POF stream, parse a POF value of the specified type that is in the passed BufferInput.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        nType - the Type ID to parse
        Throws:
        IOException - if an I/O error occurs
      • parseUserType

        protected void parseUserType​(ReadBuffer.BufferInput in,
                                     int iPos,
                                     int nType)
                              throws IOException
        Parse a User Type from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        nType - the Type ID for the User Type
        Throws:
        IOException - if an I/O error occurs
      • parseCollection

        protected void parseCollection​(ReadBuffer.BufferInput in,
                                       int iPos)
                                throws IOException
        Parse a Collection from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseUniformCollection

        protected void parseUniformCollection​(ReadBuffer.BufferInput in,
                                              int iPos)
                                       throws IOException
        Parse a Uniform Collection from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseArray

        protected void parseArray​(ReadBuffer.BufferInput in,
                                  int iPos)
                           throws IOException
        Parse an Array from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseUniformArray

        protected void parseUniformArray​(ReadBuffer.BufferInput in,
                                         int iPos)
                                  throws IOException
        Parse a Uniform Array from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseSparseArray

        protected void parseSparseArray​(ReadBuffer.BufferInput in,
                                        int iPos)
                                 throws IOException
        Parse a Sparse Array from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseUniformSparseArray

        protected void parseUniformSparseArray​(ReadBuffer.BufferInput in,
                                               int iPos)
                                        throws IOException
        Parse a Uniform Sparse Array from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseMap

        protected void parseMap​(ReadBuffer.BufferInput in,
                                int iPos)
                         throws IOException
        Parse a Map from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseUniformKeysMap

        protected void parseUniformKeysMap​(ReadBuffer.BufferInput in,
                                           int iPos)
                                    throws IOException
        Parse a Uniform-Keys Map from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • parseUniformMap

        protected void parseUniformMap​(ReadBuffer.BufferInput in,
                                       int iPos)
                                throws IOException
        Parse a Uniform Map from the POF stream.
        Parameters:
        in - the BufferInput to read from
        iPos - the position of the value that is about to be read, which is a property index, an array index, or -1
        Throws:
        IOException - if an I/O error occurs
      • main

        public static void main​(String[] asArg)
                         throws Exception
        Unit test:
         java PofParser <hex string>
         
        Parameters:
        asArg - command line arguments
        Throws:
        Exception - if an error occurs