org.ksoap2.serialization
Class AttributeContainer

java.lang.Object
  extended by org.ksoap2.serialization.AttributeContainer
Direct Known Subclasses:
SoapObject, SoapPrimitive

public class AttributeContainer
extends Object


Constructor Summary
AttributeContainer()
           
 
Method Summary
 void addAttribute(AttributeInfo attributeInfo)
          Add a new attribute by providing an AttributeInfo object.
 void addAttribute(String name, Object value)
          Adds a attribute (parameter) to the object.
protected  boolean attributesAreEqual(AttributeContainer other)
          Checks that the two objects have identical sets of attributes.
 Object getAttribute(int index)
          Get the attribute at the given index
 Object getAttribute(String name)
          Get the attribute with the given name
 int getAttributeCount()
          Returns the number of attributes
 void getAttributeInfo(int index, AttributeInfo attributeInfo)
          Places AttributeInfo of desired attribute into a designated AttributeInfo object
 boolean hasAttribute(String name)
          Knows whether the given attribute exists
 Object safeGetAttribute(String name)
          Get an attribute without chance of throwing an exception
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeContainer

public AttributeContainer()
Method Detail

getAttributeInfo

public void getAttributeInfo(int index,
                             AttributeInfo attributeInfo)
Places AttributeInfo of desired attribute into a designated AttributeInfo object

Parameters:
index - index of desired attribute
attributeInfo - designated retainer of desired attribute

getAttribute

public Object getAttribute(int index)
Get the attribute at the given index


getAttribute

public Object getAttribute(String name)
Get the attribute with the given name

Throws:
RuntimeException - if the attribute does not exist

hasAttribute

public boolean hasAttribute(String name)
Knows whether the given attribute exists


safeGetAttribute

public Object safeGetAttribute(String name)
Get an attribute without chance of throwing an exception

Returns:
the value of the attribute if it exists; null if it does not exist

getAttributeCount

public int getAttributeCount()
Returns the number of attributes

Returns:
the number of attributes

attributesAreEqual

protected boolean attributesAreEqual(AttributeContainer other)
Checks that the two objects have identical sets of attributes.

Parameters:
other -
Returns:
true of the attrubte sets are equal, false otherwise.

addAttribute

public void addAttribute(String name,
                         Object value)
Adds a attribute (parameter) to the object.

Parameters:
name - The name of the attribute
value - the value of the attribute

addAttribute

public void addAttribute(AttributeInfo attributeInfo)
Add a new attribute by providing an AttributeInfo object. AttributeInfo contains all data about the attribute, including name and value.}

Parameters:
attributeInfo - the AttributeInfo object to add.


Copyright © 2002-2011. All Rights Reserved.