Package apg

Class Parser.UdtCallback

    • Constructor Summary

      Constructors 
      Constructor Description
      UdtCallback​(Parser parser)
      Base class constructor for the UDT callback functions.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract int callback​(int offset)
      The UDT function.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • callbackData

        public final Parser.CallbackData callbackData
        Parser-provisioned data available to all UDT callback functions
    • Constructor Detail

      • UdtCallback

        public UdtCallback​(Parser parser)
        Base class constructor for the UDT callback functions.
        Parameters:
        parser - the instance of the Parser to attach this callback function to.
    • Method Detail

      • callback

        public abstract int callback​(int offset)
                              throws java.lang.Exception
        The UDT function.
        Parameters:
        offset - offset into the input string to the first character of the parsed phrase.
        Returns:
        the matched phrase length, L, or -1 if no phrase was matched. The phrase length must be in the range 0 <= L <=(n-1), where n is the remaining number of characters in the input string.
        Throws:
        java.lang.Exception - thrown if the callback function returns an illegal value. An illegal value would be a phrase length L >= n, or Illegal values are phrase lengths longer than the length of the remaining input string or a zero (empty) length by a UDT designated as non-empty. (UDTs having names beginning with "u_" are designated as non-empty. UDTs having names beginning with "e_" are designated as empty.)