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.JsonObject
input
protected org.slf4j.Logger
logger
protected OutputBuilder
output
protected Map<String,String>
properties
protected AbstractSession
session
protected AbstractSession
tokenSession
-
Constructor Summary
Constructors Constructor Description AbstractKeyword()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterKeyword(String keywordName, Keyword annotation)
Hook called after each keyword call.void
beforeKeyword(String keywordName, Keyword annotation)
Hook called before each keyword call.javax.json.JsonObject
getInput()
OutputBuilder
getOutputBuilder()
Map<String,String>
getProperties()
AbstractSession
getSession()
AbstractSession
getTokenSession()
boolean
onError(Exception e)
Hook called when an exception is thrown by a keyword or by the beforeKeyword hookvoid
setInput(javax.json.JsonObject input)
void
setOutputBuilder(OutputBuilder outputBuilder)
void
setProperties(Map<String,String> properties)
void
setSession(AbstractSession session)
void
setTokenSession(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
-
-