|
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.WrapperDateOut
public class WrapperDateOut
The class wrapping the root ADBBean
output element representing the results for
the formateDate()
SOAP method.
The response contains also some metadata (e.g. the status message) and a fixed list
of simple data types. Since these data types are not an array (i.e. we have always the same number
of output fields) AND since these data are simple types (i.e. they are not XSD nested complex types)
it's not worthy to define another subclass of the WrapperOut
class for these data,
but we can store them directly into the WrapperDateOut
object.
Hint: compare this class with the WrapperInformationOut
class, which doesn't store
any data as simple class fields, but delegates data management to the inner records of wrappers.
Hence the WrapperDateOut
class could be considered the leading example of a wrapper
needing to model a SOAP element containing just few simple types.
Field Summary | |
---|---|
static java.lang.StringBuffer |
NO_DATE
Static default value for the FIRST field (should match one of the static reference values). |
protected java.lang.StringBuffer |
the_date
Output field wrapped directly by this class. |
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 | |
---|---|
WrapperDateOut()
Stateless constructor, loading the default values into this wrapper. |
|
WrapperDateOut(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. |
java.lang.StringBuffer |
getDate()
Getter method. |
void |
setDate(java.lang.String value)
Setter method (overloaded). |
void |
setDate(java.lang.StringBuffer value)
Setter method. |
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 |
Field Detail |
---|
protected java.lang.StringBuffer the_date
public static final java.lang.StringBuffer NO_DATE
Constructor Detail |
---|
public WrapperDateOut()
ADBBean
element is instantiated, because we delegate
this task to the validate()
method in order to grant loose coupling.
setDefaults()
public WrapperDateOut(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 messagepublic java.lang.StringBuffer getDate()
public void setDate(java.lang.StringBuffer value)
public void setDate(java.lang.String value)
|
Build 18/09/2012 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |