soap tutorial

adriani.jws.template.wrappers
Class Wrapper

java.lang.Object
  extended by adriani.jws.template.wrappers.Wrapper
Direct Known Subclasses:
WrapperIn, WrapperInformation, WrapperOut

public abstract class Wrapper
extends java.lang.Object

Wrapper - general class wrapping all the ADBBean elements describing the "inner core" of the SOAP response, i.e. a set of fields bundled together to create a record-like structure. Usually this set is wrapped inside another WrapperIn or WrapperOut object, for example :


 <WrapperOut>
   status  (1 field)
   message (1 field)
   records (1..n occurrences of the <Wrapper> object)
 </WrapperOut>
 


Field Summary
protected  java.lang.Object element
          The wrapped ADBBean element.
protected static java.lang.String leadingName
          Beginning of each logging message produced by this class.
protected static WSLogger logger
          Retrieving the logger instance to be used for this class (static).
static java.lang.StringBuffer NO_NUMBER
          Static string value depicting a undefined number field.
static int NOT_AVAILABLE
          Numeric reference value for all the empty (null) integer values.
static java.math.BigInteger NOT_BIG_INTEGER
          Static BigInteger value depicting a undefined number field.
static java.lang.StringBuffer UNDEFINED
          String reference value for all the empty (null) text values.
 
Constructor Summary
Wrapper()
           
 
Method Summary
 boolean compareSB(java.lang.StringBuffer first, java.lang.StringBuffer second)
          Helper method, used to compare the value of two StringBuffer objects.
 java.lang.Object getElement()
          Return the ADBBean object wrapped by this class.
abstract  void setDefaults()
          Load all the STATIC default values (defined in this class) into the corresponding class attributes.
abstract  boolean validate()
          Validation is performed by the Axis2 ADBBean objects ( e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

element

protected java.lang.Object element
The wrapped ADBBean element.


NO_NUMBER

public static java.lang.StringBuffer NO_NUMBER
Static string value depicting a undefined number field.
Example: if validation fails for some input numeric field, and if the corresponding class attribute (of this wrapper) is a string type, the NO_NUMBER string is stored into the class attribute in order to acknowledge this situation.
Current implementation stores the text UNSET in the NO_NUMBER field.


NOT_AVAILABLE

public static int NOT_AVAILABLE
Numeric reference value for all the empty (null) integer values.


NOT_BIG_INTEGER

public static final java.math.BigInteger NOT_BIG_INTEGER
Static BigInteger value depicting a undefined number field.


UNDEFINED

public static java.lang.StringBuffer UNDEFINED
String reference value for all the empty (null) text values.


leadingName

protected static java.lang.String leadingName
Beginning of each logging message produced by this class.


logger

protected static WSLogger logger
Retrieving the logger instance to be used for this class (static).

Constructor Detail

Wrapper

public Wrapper()
Method Detail

validate

public abstract boolean validate()
                          throws WrapperFault
Validation is performed by the Axis2 ADBBean objects ( e.g. NameType.setNameType() ). 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, not elsewhere.

Returns:
true if all the mandatory ADBBean objects have been set correctly
Throws:
WrapperFault

setDefaults

public abstract void setDefaults()
Load all the STATIC default values (defined in this class) into the corresponding class attributes. This method should be called by the constructor if we need to make sure that we "empty wrapper" contains always some good default values matching the WSDL constrains.


getElement

public java.lang.Object getElement()
Return the ADBBean object wrapped by this class. Usually this method is called after validation, if successful.

Returns:
a reference to the ADBBean object wrapped by this class

compareSB

public boolean compareSB(java.lang.StringBuffer first,
                         java.lang.StringBuffer second)
Helper method, used to compare the value of two StringBuffer objects. Usually this method is used by isXXX() methods or hasXXX() methods of the children classes.

Parameters:
first - a StringBuffer object
second - another StringBuffer object
Returns:
true if the two string object contains the same text

Build 18/09/2012

Morpheus Quality Technologies - Making the Zion software
Copyright © 2009-2013 Morpheus Quality Technologies. All Rights Reserved