net.sf.jplist.core
Class DictionaryElement

java.lang.Object
  extended by net.sf.jplist.core.DictionaryElement
All Implemented Interfaces:
IElement

public class DictionaryElement
extends java.lang.Object
implements IElement

Implements a DictionaryElement. A DictionaryElement is a container type for NameValuePair objects. Each NameValuePair object contains a String key and a value which can be any object that implements IElement.

Version:
$Revision: 1.2 $
Author:
Sujit Pal (spal@users.sourceforge.net)

Field Summary
 
Fields inherited from interface net.sf.jplist.core.IElement
ARRAY, DATA, DICTIONARY, DOCUMENT, STRING
 
Constructor Summary
DictionaryElement()
          Instantiate a DictionaryElement.
 
Method Summary
 void addContent(java.lang.Object obj)
          Adds a single name-value pair to the DictionaryElement.
 java.lang.Object getContent()
          Returns a Map of name value pairs.
 void setContent(java.lang.Object obj)
          Sets the contents of a DictionaryElement.
 int typeOf()
          Returns the type of the IElement object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionaryElement

public DictionaryElement()
Instantiate a DictionaryElement.

Method Detail

getContent

public java.lang.Object getContent()
Returns a Map of name value pairs.

Specified by:
getContent in interface IElement
Returns:
a Map of name value pairs. Caller needs to cast.
See Also:
IElement.getContent()

addContent

public void addContent(java.lang.Object obj)
                throws JPListException
Adds a single name-value pair to the DictionaryElement.

Specified by:
addContent in interface IElement
Parameters:
obj - the Object to add.
Throws:
JPListException - if the Object is not a NameValuePair.
See Also:
IElement.addContent(java.lang.Object)

setContent

public void setContent(java.lang.Object obj)
                throws JPListException
Sets the contents of a DictionaryElement.

Specified by:
setContent in interface IElement
Parameters:
obj - the Object to set.
Throws:
JPListException - if the Object is not a Map.
See Also:
IElement.setContent(java.lang.Object)

typeOf

public int typeOf()
Returns the type of the IElement object.

Specified by:
typeOf in interface IElement
Returns:
the type of IElement object.
See Also:
IElement.typeOf()