public class ScriptValidator extends Object implements MessageValidator
Constructor and Description |
---|
ScriptValidator() |
Modifier and Type | Method and Description |
---|---|
String |
getEngine()
Gets the Java Script Engine.
|
String |
getScript()
Gets the Java script.
|
String |
getScriptFile()
Gets the script file.
|
boolean |
isValid(Message originalMessage,
Message response,
Properties messageAttributes)
Makes sure the provided message is valid.
|
ScriptValidator |
setEngine(String engine)
Sets the Java Script Engine.
|
ScriptValidator |
setScript(String script)
Sets the Java script.
|
void |
setScriptAsElement(Element script)
Sets the Java script taken from
Element 's text content. |
ScriptValidator |
setScriptFile(String scriptFile)
Sets the file from which the Java script is taken.
|
public boolean isValid(Message originalMessage, Message response, Properties messageAttributes)
MessageValidator
isValid
in interface MessageValidator
originalMessage
- The message that has been sent.response
- A response for the original message.messageAttributes
- A snapshot of sequences' values and possible other attributes used for sending a message. These attributes can be used by a validator to replace placeholders.true
if the message passes all validations.public String getEngine()
public ScriptValidator setEngine(String engine)
engine
- The Java Script Engine.public String getScript()
public ScriptValidator setScript(String script)
script
- The Java script.public void setScriptAsElement(Element script)
Element
's text content.script
- The DOM element from whose content the Java script is taken.public String getScriptFile()
public ScriptValidator setScriptFile(String scriptFile)
scriptFile
- The script file.Copyright © 2010–2017 PerfCake Community. All rights reserved.