soap tutorial

adriani.jws.template.wrappers
Class WrapperDateOut

java.lang.Object
  extended by adriani.jws.template.wrappers.Wrapper
      extended by adriani.jws.template.wrappers.WrapperOut
          extended by adriani.jws.template.wrappers.WrapperDateOut

public class WrapperDateOut
extends WrapperOut

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

the_date

protected java.lang.StringBuffer the_date
Output field wrapped directly by this class. Since we need to return the output date in many different formats, we must use a string-like object (and not a SOAP date).


NO_DATE

public static final java.lang.StringBuffer NO_DATE
Static default value for the FIRST field (should match one of the static reference values).

Constructor Detail

WrapperDateOut

public WrapperDateOut()
Stateless constructor, loading the default values into this wrapper. This means that all the class attributes are defined, but no ADBBean element is instantiated, because we delegate this task to the validate() method in order to grant loose coupling.

See Also:
setDefaults()

WrapperDateOut

public WrapperDateOut(Wrapper[] array)
Stateful constructor, creating an Wrapper set with the input array.

Parameters:
array - the array of Wrapper[]
Method Detail

validate

public boolean validate()
                 throws WrapperFaultOut
Validation is performed by the Eclipse's 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.

Remark: to grant LOOSE COUPLING to the WSDL, the ADBBean Java classes should be used only within this method and in the forceStatus(), forceMessage() methods, not elsewhere.

Specified by:
validate in class Wrapper
Returns:
true if all the mandatory ADBBean objects have been set correctly
Throws:
WrapperFaultOut

setDefaults

public 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. status and message).

Overrides:
setDefaults in class WrapperOut
See Also:
Wrapper, WrapperOut.forceMessage(String message)

forceStatus

public 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. 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.

Specified by:
forceStatus in class WrapperOut
Parameters:
value - the response status value

forceMessage

public 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). This method is used when validation fails and it's necessary to communicate the error in a message field of the wrapped ADBBean element.

Remark: this method MUST be called only after validation, because we want to put all the building logic of the ADBBean structure in the validate() method.

Specified by:
forceMessage in class WrapperOut
Parameters:
message - the validation error message

getDate

public java.lang.StringBuffer getDate()
Getter method.


setDate

public void setDate(java.lang.StringBuffer value)
Setter method.


setDate

public void setDate(java.lang.String value)
Setter method (overloaded).


Build 19/03/2014

Morpheus Technologies - making the Zion software
Copyright © 2009-2014 Morpheus Technologies. All Rights Reserved