|
soap tutorial | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectadriani.jws.template.wrappers.Wrapper
adriani.jws.template.wrappers.WrapperOut
adriani.jws.template.wrappers.WrapperInformationOut
public class WrapperInformationOut
The class wrapping the root ADBBean
output element representing the results for
the getInformation()
SOAP method.
In this case the response contains also some metadata (e.g. the status message) and an array
of records: each of these records should be wrapped by a single WrapperInformation
object.
Hint: compare this class with the WrapperDateOut
class, which doesn't store
data as an inner records of wrappers, but store data directly into some simple class fields.
Hence the WrapperInformationOut
class could be considered the leading example of a wrapper
needing to model a SOAP element containing some complex types and/or records.
Field Summary |
---|
Fields inherited from class adriani.jws.template.wrappers.WrapperOut |
---|
details, leadingName, message, MESSAGE_NOK, MESSAGE_OK, MESSAGE_UNSET, MESSAGE_WRONG, NO_DETAILS, records, status, STATUS_OK, STATUS_UNSET, STATUS_WRONG |
Fields inherited from class adriani.jws.template.wrappers.Wrapper |
---|
element, logger, NO_NUMBER, NOT_AVAILABLE, NOT_BIG_INTEGER, UNDEFINED |
Constructor Summary | |
---|---|
WrapperInformationOut()
Stateless constructor, loading the default values into this wrapper. |
|
WrapperInformationOut(Wrapper[] array)
Stateful constructor, creating an Wrapper set with the input array. |
Method Summary | |
---|---|
void |
forceMessage(java.lang.String message)
Set a string message in the inner ADBBean element, without checking for validation and
overwriting the previous value of the message class attribute (in any). |
void |
forceStatus(int value)
Set an integer value in the wrapped ADBBean element, without checking for validation and ignoring the value of the status class attribute. |
void |
setDefaults()
Load all the STATIC default values (defined in this class) into the corresponding class attributes, in this case we create one element array with just one WrapperInformation object
(set with his default values), then we set the general purposes class fields
(i.e. |
boolean |
validate()
Validation is performed by the Eclipse's ADBBean objects (e.g. |
Methods inherited from class adriani.jws.template.wrappers.WrapperOut |
---|
getDetails, getMessage, getRecords, getStatus, reset, setDetails, setMessage, setRecords, setStatus |
Methods inherited from class adriani.jws.template.wrappers.Wrapper |
---|
compareSB, getElement |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WrapperInformationOut()
ADBBean
element is instantiated, because we delegate
this task to the validate()
method in order to grant loose coupling.
setDefaults()
public WrapperInformationOut(Wrapper[] array)
Wrapper
set with the input array.
array
- the array of Wrapper[]
Method Detail |
---|
public boolean validate() throws WrapperFaultOut
ADBBean
objects (e.g. TownType.setTownType() etc.)
If the validation process is successful, the resulting ADBBean
object is stored as
class field to save computation time, since after validation we expect that the method
getElement()
should be invoked.ADBBean
Java classes
should be used only within this method and in the forceStatus()
,
forceMessage()
methods, not elsewhere.
validate
in class WrapperOut
true
if all the mandatory ADBBean
objects have been set correctly
WrapperFaultOut
public void setDefaults()
WrapperInformation
object
(set with his default values), then we set the general purposes class fields
(i.e. status and message).
setDefaults
in class WrapperOut
Wrapper
,
WrapperOut.forceMessage(String message)
public void forceStatus(int value)
status
class attribute. This method is used when validation fails and it's
necessary to set the response status in the status field of the wrapped ADBBean element.
forceStatus
in class WrapperOut
value
- the response status valuepublic void forceMessage(java.lang.String message)
ADBBean
element, without checking for validation and
overwriting the previous value of the message
class attribute (in any).
This method is used when validation fails and it's necessary to communicate the error in a message field
of the wrapped ADBBean
element.ADBBean
structure in the validate()
method.
forceMessage
in class WrapperOut
message
- the validation error message
|
Build 18/09/2012 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |