Package step.handlers.javahandler
Class AbstractKeyword
- java.lang.Object
-
- step.handlers.javahandler.AbstractKeyword
-
public class AbstractKeyword extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.json.JsonObjectinputprotected org.slf4j.Loggerloggerprotected OutputBuilderoutputprotected Map<String,String>propertiesprotected AbstractSessionsessionprotected AbstractSessiontokenSession
-
Constructor Summary
Constructors Constructor Description AbstractKeyword()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterKeyword(String keywordName, Keyword annotation)Hook called after each keyword call.voidbeforeKeyword(String keywordName, Keyword annotation)Hook called before each keyword call.javax.json.JsonObjectgetInput()OutputBuildergetOutputBuilder()Map<String,String>getProperties()AbstractSessiongetSession()AbstractSessiongetTokenSession()booleanonError(Exception e)Hook called when an exception is thrown by a keyword or by the beforeKeyword hookvoidsetInput(javax.json.JsonObject input)voidsetOutputBuilder(OutputBuilder outputBuilder)voidsetProperties(Map<String,String> properties)voidsetSession(AbstractSession session)voidsetTokenSession(AbstractSession tokenSession)
-
-
-
Field Detail
-
logger
protected org.slf4j.Logger logger
-
output
protected OutputBuilder output
-
input
protected javax.json.JsonObject input
-
session
protected AbstractSession session
-
tokenSession
protected AbstractSession tokenSession
-
-
Method Detail
-
getSession
public AbstractSession getSession()
-
setSession
public void setSession(AbstractSession session)
-
getTokenSession
public AbstractSession getTokenSession()
-
setTokenSession
public void setTokenSession(AbstractSession tokenSession)
-
getInput
public javax.json.JsonObject getInput()
-
setInput
public void setInput(javax.json.JsonObject input)
-
getOutputBuilder
public OutputBuilder getOutputBuilder()
-
setOutputBuilder
public void setOutputBuilder(OutputBuilder outputBuilder)
-
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 emptyannotation- 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 emptyannotation- the annotation of the called keyword
-
-