public abstract class ActionReporter extends ActionReport
ActionReport.ExitCode, ActionReport.MessagePart
Modifier and Type | Field and Description |
---|---|
protected String |
actionDescription |
protected String |
contentType |
static String |
EOL_MARKER |
protected Throwable |
exception |
protected ActionReport.ExitCode |
exitCode |
protected List<ActionReporter> |
subActions |
protected ActionReport.MessagePart |
topMessage |
Constructor and Description |
---|
ActionReporter()
Creates a new instance of HTMLActionReporter
|
Modifier and Type | Method and Description |
---|---|
ActionReport |
addSubActionsReport() |
void |
appendMessage(String message) |
String |
getActionDescription() |
ActionReport.ExitCode |
getActionExitCode() |
void |
getCombinedMessages(ActionReporter aReport,
StringBuilder sb)
Returns combined messages.
|
String |
getContentType()
Returns the content type to be used in sending the response back to
the client/caller.
|
Throwable |
getFailureCause() |
String |
getMessage() |
List<ActionReporter> |
getSubActionsReport() |
ActionReport.MessagePart |
getTopMessagePart() |
boolean |
hasFailures()
return true if the action report or a subaction report has ExitCode.FAILURE.
|
boolean |
hasSuccesses()
return true if the action report or a subaction report has ExitCode.SUCCESS.
|
boolean |
hasWarnings()
return true if the action report or a subaction report has ExitCode.WARNING.
|
boolean |
isFailure() |
boolean |
isSuccess() |
boolean |
isWarning() |
void |
setActionDescription(String message) |
void |
setActionExitCode(ActionReport.ExitCode exitCode)
Sets the exit code for the report.
|
void |
setContentType(String s) |
void |
setFailure()
Sets the exit code of the report to failure
|
void |
setFailureCause(Throwable t) |
void |
setMessage(InputStream in) |
void |
setMessage(String message) |
void |
setSuccess() |
void |
setWarning() |
failure, failure, findProperty, getExtraProperties, getResultType, setExtraProperties, setResultType, writeReport
protected Throwable exception
protected String actionDescription
protected List<ActionReporter> subActions
protected ActionReport.ExitCode exitCode
protected ActionReport.MessagePart topMessage
protected String contentType
public static final String EOL_MARKER
public ActionReporter()
public void setFailure()
public boolean isFailure()
public void setWarning()
public boolean isWarning()
public boolean isSuccess()
public void setSuccess()
public void setActionDescription(String message)
setActionDescription
in class ActionReport
public String getActionDescription()
public void setFailureCause(Throwable t)
setFailureCause
in class ActionReport
public Throwable getFailureCause()
getFailureCause
in class ActionReport
public ActionReport.MessagePart getTopMessagePart()
getTopMessagePart
in class ActionReport
public ActionReport addSubActionsReport()
addSubActionsReport
in class ActionReport
public List<ActionReporter> getSubActionsReport()
getSubActionsReport
in class ActionReport
public void setActionExitCode(ActionReport.ExitCode exitCode)
ActionReport
setActionExitCode
in class ActionReport
public ActionReport.ExitCode getActionExitCode()
getActionExitCode
in class ActionReport
public void setMessage(String message)
setMessage
in class ActionReport
public void appendMessage(String message)
appendMessage
in class ActionReport
public String getMessage()
getMessage
in class ActionReport
public void setMessage(InputStream in)
setMessage
in class ActionReport
public String getContentType()
This is the default type. Specific subclasses of ActionReporter might override the method to return a different valid type.
getContentType
in class ActionReport
public void setContentType(String s)
setContentType
in class ActionReport
public void getCombinedMessages(ActionReporter aReport, StringBuilder sb)
Note: This method is a recursive implementation.
aReport
- a given (usually top-level) ActionReporter instancesb
- StringBuilder instance that contains all the messagespublic boolean hasSuccesses()
ActionReport
hasSuccesses
in class ActionReport
public boolean hasWarnings()
ActionReport
hasWarnings
in class ActionReport
public boolean hasFailures()
ActionReport
hasFailures
in class ActionReport
Copyright © 2018. All rights reserved.