Class AbstractKeyword


  • public class AbstractKeyword
    extends Object
    • Constructor Detail

      • AbstractKeyword

        public AbstractKeyword()
    • Method Detail

      • setTokenSession

        public void setTokenSession​(AbstractSession tokenSession)
      • getInput

        public javax.json.JsonObject getInput()
      • setInput

        public void setInput​(javax.json.JsonObject input)
      • setOutputBuilder

        public void setOutputBuilder​(OutputBuilder outputBuilder)
      • setProperties

        public void setProperties​(Map<String,​String> properties)
      • onError

        public boolean onError​(Exception e)
        Hook called when an exception is thrown by a keyword or by the beforeKeyword hook
        Parameters:
        e - the exception thrown
        Returns:
        true if the exception passed as argument has to be rethrown. Set to false if the error has already been handled by this hook and shouldn't be handled.
      • beforeKeyword

        public void beforeKeyword​(String keywordName,
                                  Keyword annotation)
        Hook called before each keyword call. If an exception is thrown by this method, the keyword won't be executed (but afterKeyword and onError will)
        Parameters:
        keywordName - the name of the keyword. Will be the function name if annotation.name() is empty
        annotation - the annotation of the called keyword
      • afterKeyword

        public void afterKeyword​(String keywordName,
                                 Keyword annotation)
        Hook called after each keyword call. This method is always called. If an exception is thrown by the keyword or the beforeKeyword hook, this method is called after the onError hook.
        Parameters:
        keywordName - the name of the keyword. Will be the method name if annotation.name() is empty
        annotation - the annotation of the called keyword