public class ToolResult extends java.lang.Object implements IToolResult
IToolResult.| Constructor and Description |
|---|
ToolResult(IToolContext pToolContext)
Creates a new tool result without a tool message, no output parameters
and severity
ToolResultSeverity.OK. |
ToolResult(IToolContext pToolContext,
IToolOutput pToolOutput)
Creates a new tool result with tool output, no message and severity
ToolResultSeverity.OK. |
ToolResult(IToolContext pToolContext,
java.lang.String pMessage,
IToolResultSeverity pSeverity)
Creates a new tool result with a message and severity.
|
ToolResult(IToolContext pToolContext,
java.lang.String pMessage,
IToolResultSeverity pSeverity,
IToolOutput pToolOutput)
Creates a new tool result with a message, severity and tool output.
|
| Modifier and Type | Method and Description |
|---|---|
IToolResultSeverity |
getSeverity()
Gets the severity of the execution result.
|
IToolContext |
getToolContext()
Gets the tool context that was used for executing the tool descriptor.
|
ToolDescriptor |
getToolDescriptor()
Gets executed tool descriptor.
|
java.lang.String |
getToolMessage()
Gets the returned tool message or
null, if the tool does not
return a message. |
IToolOutput |
getToolOutput()
Returns the
IToolOutput. |
void |
setSeverity(IToolResultSeverity pSeverity)
Sets the result's severity.
|
void |
setToolMessage(java.lang.String pToolMessage)
Sets the result message.
|
void |
setToolOutput(IToolOutput pToolOutput)
Sets the result's tool output.
|
public ToolResult(IToolContext pToolContext)
ToolResultSeverity.OK.pToolContext - the tool contextpublic ToolResult(IToolContext pToolContext, IToolOutput pToolOutput)
ToolResultSeverity.OK.pToolContext - the tool contextpToolOutput - the tool outputpublic ToolResult(IToolContext pToolContext, java.lang.String pMessage, IToolResultSeverity pSeverity)
pToolContext - the tool contextpMessage - tool messagepSeverity - severitypublic ToolResult(IToolContext pToolContext, java.lang.String pMessage, IToolResultSeverity pSeverity, IToolOutput pToolOutput)
pToolContext - the tool contextpMessage - tool messagepSeverity - severitypToolOutput - tool outputpublic java.lang.String getToolMessage()
IToolResultnull, if the tool does not
return a message.
Tool messages will always be displayed to the user after the action has finished or when the tool returned an error severity. Therefore tools should not return messages for debug/trace purposes, since it will affect the user experience.
getToolMessage in interface IToolResultnullIToolResult.getSeverity()public IToolResultSeverity getSeverity()
IToolResultThe returned severity can affect the executed action in two ways:
Information, Warning and Error
severities affect how returned tool messages are being displayed.
Error severity will cause the action to be aborted,
preventing any subsequent tool descriptor to be executed.
getSeverity in interface IToolResultToolResultSeveritypublic ToolDescriptor getToolDescriptor()
IToolResultgetToolDescriptor in interface IToolResultpublic IToolContext getToolContext()
IToolResultgetToolContext in interface IToolResultpublic IToolOutput getToolOutput()
IToolResultIToolOutput.getToolOutput in interface IToolResultpublic void setToolOutput(IToolOutput pToolOutput)
pToolOutput - the output to set. Must not be null.public void setSeverity(IToolResultSeverity pSeverity)
pSeverity - the severity to set. Must not be null.public void setToolMessage(java.lang.String pToolMessage)
pToolMessage - the tool message. Can be null.Copyright © 2015 Micro Focus GmbH. All rights reserved.