public class ErrorCodeParameter extends ProgramParameter implements java.io.Serializable
An API error code parameter is a variable-length structure that is common to most of the system APIs. The error code parameter controls how errors are returned to the application. The error code parameter must be initialized before the application calls the API. Depending on how the error code structure is set, this parameter either returns information associated with an error condition, or causes the Toolbox to return the errors as AS400Message objects. For some APIs, the error code parameter is optional. If you do not code the optional error code parameter, the API returns both diagnostic and escape messages. If you do code the optional error code parameter, the API returns only escape messages or error codes, and never returns diagnostic messages.
ProgramCall
,
ServiceProgramCall
,
AS400Message
,
Serialized FormPASS_BY_REFERENCE, PASS_BY_VALUE
Constructor and Description |
---|
ErrorCodeParameter()
Constructs a simple default ErrorCodeParameter object.
|
ErrorCodeParameter(boolean returnSubstitutionData,
boolean useCCHAR)
Constructs an ErrorCodeParameter object.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMessageID()
Returns the error message ID that was returned in the error code parameter.
|
java.lang.String |
getSubstitutionData()
Returns the error message substitution data that was returned in the error code parameter.
|
addPropertyChangeListener, addVetoableChangeListener, getInputData, getOutputData, getOutputDataLength, getParameterType, isNullParameter, removePropertyChangeListener, removeVetoableChangeListener, setInputData, setNullParameter, setOutputDataLength, setParameterType
public ErrorCodeParameter()
ProgramCall.getMessageList()
or ServiceProgramCall.getMessageList()
.
AS400Message
public ErrorCodeParameter(boolean returnSubstitutionData, boolean useCCHAR)
getMessageID()
and getSubstitutionData()
.
Usage note: This constructor creates error code parameters which cause the run() methods of ProgramCall and ServiceProgramCall to return true even if the called program failed. With this constructor, in order to detect program failure the application must examine the error information returned in the ErrorCodeParameter.
returnSubstitutionData
- Whether the error information returned from the system is to include error message substitution data.
The default is false; that is, error message substitution data is not returned.useCCHAR
- Whether convertible character (CCHAR) support is to be used.
The default is false; that is, CCHAR support is not used.ProgramCall.run()
,
ServiceProgramCall.run()
public java.lang.String getMessageID()
public java.lang.String getSubstitutionData()
MessageFile.getMessage(String,String)
.