|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xins.server.FunctionResult
Result from a function call. Defines an error code, parameters and output data section. All are optional.
FunctionRequest
Constructor Summary | |
FunctionResult()
Creates a new successful FunctionResult instance with no
parameters. |
|
FunctionResult(String code)
Creates a new FunctionResult instance with no parameters. |
|
FunctionResult(String code,
BasicPropertyReader parameters)
Creates a new FunctionResult instance with a specified set
of parameters. |
Method Summary | |
protected void |
add(Element element)
Adds a new Element to the data element. |
InvalidResponseResult |
checkOutputParameters()
Checks that the output parameters are set as specified. |
Element |
getDataElement()
Gets the data element from this result. |
String |
getErrorCode()
Returns the result code. |
String |
getParameter(String name)
Gets the value of the specified parameter. |
PropertyReader |
getParameters()
Gets all parameters. |
protected void |
param(String name,
String value)
Adds an output parameter to the result. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FunctionResult()
FunctionResult
instance with no
parameters.
public FunctionResult(String code)
FunctionResult
instance with no parameters.
code
- the error code, can be null
if the result is successful.public FunctionResult(String code, BasicPropertyReader parameters)
FunctionResult
instance with a specified set
of parameters.
code
- the error code, can be null
if the result is successful.parameters
- the parameters for the result, can be null
if there are
no parameters.Method Detail |
public String getErrorCode()
null
if no code was returned.public InvalidResponseResult checkOutputParameters()
InvalidResponseResult
is returned. Otherwise the parameters
are considered valid, and null
is returned.
The implementation of this method in class FunctionResult
always returns null
.
InvalidResponseResult
instance if at least one output
parameter is missing or invalid, or null
otherwise.protected void param(String name, String value) throws IllegalArgumentException
name
- the name of the output parameter, not null
and not an
empty string.value
- the value of the output parameter, not null
and not an
empty string.
IllegalArgumentException
- if name == null || "".equals(name)
|| value == null || "".equals(value)
.public PropertyReader getParameters()
PropertyReader
containing all parameters, never null
;
the keys will be the names of the parameters
(String
objects, cannot be null
),
the values will be the parameter values
(String
objects as well, cannot be null
).public String getParameter(String name) throws IllegalArgumentException
name
- the parameter element name, cannot be null
.
null
if the value is not set.
IllegalArgumentException
- if name == null
.protected void add(Element element) throws IllegalArgumentException
Element
to the data element.
element
- the new element to add to the result, cannot be null
.
IllegalArgumentException
- if element == null
.public Element getDataElement()
null
.public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |