Class ExpressionPromptEventHandlerImpl

    • Constructor Detail

      • ExpressionPromptEventHandlerImpl

        public ExpressionPromptEventHandlerImpl()
    • Method Detail

      • processRequest

        public boolean processRequest​(RequestKeys keys)
                               throws WebException
        Description copied from class: GenericEventHandler
        Logic to process the event. Specific event handler implementation extending this class will need to override the default behavior.
        Specified by:
        processRequest in interface WebEventHandler
        Overrides:
        processRequest in class GenericEventHandler
        Parameters:
        keys - the RequestKeys object containing event ID, sources, and any other information.
        Returns:
        true if handling succeeds; false if the event is ignored and not handled.
        Throws:
        WebException - thrown if handling of the request fails.
      • initUsingKeys

        protected void initUsingKeys​(RequestKeys keys)
        Initialize the event handler using the request keys Sets up protected variables _keys, _event,_position
        Parameters:
        keys - - the request keys
      • handleCancelPrompt

        protected boolean handleCancelPrompt()
        Cancels the web prompt
        Returns:
        - true if there is no exception
      • getValuesFromRequest

        protected java.lang.String[] getValuesFromRequest​(int arg,
                                                          int index,
                                                          java.lang.String delim)
        Returns a string array containing values corresponding to the argument from the request keys collection.
        Parameters:
        arg - - the argument id for the argument
        index - - the position in the collection
        delim - - the delimiter string. If the delimiter is specified, argument value is separated by the delimiter.
        Returns:
        the string array of values
      • getIntValue

        protected int getIntValue​(java.lang.String str,
                                  java.lang.String msg)
                           throws WebException
        Returns the int value based on the String. If there is an error, throws a WebException with the error message.
        Parameters:
        str - - String to parse.
        msg - - Error message when there is a parsing error.
        Returns:
        the parsed integer value from the string
        Throws:
        WebException - - when the String could not be converted to integer.
      • getAppendedIntValue

        protected int getAppendedIntValue​(java.lang.String str,
                                          int defVal)
        Return the integer value from the string. If the string has a prefix, it removes the prefix and returns the appended integer value
        Parameters:
        str - - the String to parse
        defVal - - the default value if the parsing fails
        Returns:
        the integer value which is appended at the end of the string
      • getIntValue

        protected int getIntValue​(java.lang.String str,
                                  int defaultVal)
        Returns the integer value from the string
        Parameters:
        str - - the String to be parsed
        defaultVal - - the default value to be returned if the parsing fails
        Returns:
        - the integer value from the parsed string
      • getIncrementalFetchParameter

        protected java.lang.String getIncrementalFetchParameter​(int arg,
                                                                int position)
        Returns the incremental fetch parameter value. The value can be either a prefixed key or it could be just a value.
        Parameters:
        arg - - int the event argument id.
        position - - the position of the argument.
        Returns:
        String the value for the parameter.
      • getAnswerFormat

        protected int getAnswerFormat​(int position)
                               throws WebException
        Returns the answer Format being used from the request keys
        Parameters:
        position - the prompt position
        Returns:
        int value from EnumPromptAnswerFormat
        Throws:
        WebException - - if the answer format is unrecognized
      • getSessionInfo

        protected WebSessionInfo getSessionInfo()
        Returns the WebSessionInfo object associated with the prompt This method throws an IllegalStateException if the session is null.
        Returns:
        WebSessionInfo object associated with the prompt
      • applyLocalSettings

        protected void applyLocalSettings​(WebObjectSource wos)
        Sets minimal flags on the WebObjectSource
        Parameters:
        wos - - WebObjectSource
      • checkClearAnswer

        protected boolean checkClearAnswer​(java.lang.String answer)
        Based on the Prompt answer option and the answer string, this method calls clear prompt answer.
        Parameters:
        answer - - answer for the prompt
        Returns:
        true if the method is successful