Class TagValTextParser


  • public class TagValTextParser
    extends java.lang.Object
    This is the parser implementation that understands tag value format and can convert the tags back into a series of tags and values suitable for the protocol to decode messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      TagValTextParser​(java.nio.ByteBuffer buffer)
      Creates an instance that contains all the tags and values in a map, that can then be used to extract the message.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getValue​(java.lang.String keyMsgType)
      Gets the value associated with the key from the message.
      int getValueAsInt​(java.lang.String keyIdField)
      Calls the getValue method first and the converts to an integer.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TagValTextParser

        public TagValTextParser​(java.nio.ByteBuffer buffer)
                         throws java.io.IOException
        Creates an instance that contains all the tags and values in a map, that can then be used to extract the message.
        Parameters:
        buffer - a buffer containing a message.
        Throws:
        java.io.IOException - if the buffer is invalid
    • Method Detail

      • getValue

        public java.lang.String getValue​(java.lang.String keyMsgType)
                                  throws java.io.IOException
        Gets the value associated with the key from the message. This version throws an exception if the key is not available and should be used for mandatory fields
        Parameters:
        keyMsgType - the key to obtain
        Returns:
        the associated value
        Throws:
        java.io.IOException
      • getValueAsInt

        public int getValueAsInt​(java.lang.String keyIdField)
                          throws java.io.IOException
        Calls the getValue method first and the converts to an integer.
        Parameters:
        keyIdField - the key to obtain
        Returns:
        the integer value associated
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object