org.ksoap2.serialization
Class NullSoapObject

java.lang.Object
  extended by org.ksoap2.serialization.NullSoapObject

public class NullSoapObject
extends Object

A class that implements only toString(). This is useful in the case where you have a SoapObject representing an optional property in your SOAP response.

Example:

 
 private String getAge(SoapObject person) {
   return person.safeGetProperty("age").toString();
 }
 
 
Now it is safe to always try and get the age property (assuming your downstream code can handle age).


Constructor Summary
NullSoapObject()
           
 
Method Summary
 String toString()
          Overridden specifically to always return null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NullSoapObject

public NullSoapObject()
Method Detail

toString

public String toString()
Overridden specifically to always return null. See the example in this class's description as to how this can be useful.

Overrides:
toString in class Object
Returns:
null
See Also:
SoapObject.safeGetProperty(String)


Copyright © 2002-2011. All Rights Reserved.