uk.org.iscream.cms.util
Class XMLPacket

java.lang.Object
  extended byuk.org.iscream.cms.util.XMLPacket

public class XMLPacket
extends Object

Object in which to store incoming XML data for processing by a component of the system.

Version:
$Id: XMLPacket.java,v 1.15 2003/02/05 14:27:59 tdb Exp $
Author:
$Author: tdb $

Field Summary
private  String _name
          This is the friendly identifier of the component this class is running in.
private  HashMap _params
          A HashMap of parameters
 String REVISION
          The current CVS revision of this class
 
Constructor Summary
XMLPacket()
           
 
Method Summary
 void addParam(String key, String value)
          Add a key and value pair to the HashMap.
 boolean containsKey(String key)
          Find if a particular key exists in the HashMap.
 String getParam(String key)
          Return the value associated with a particular key.
 Set getSet()
          Return a Set of the keys in the HashMap.
 String printAll()
          Print out the entire HashMap.
 String toString()
          Overrides the Object.toString() method to provide clean logging (every class should have this).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REVISION

public final String REVISION
The current CVS revision of this class

See Also:
Constant Field Values

_params

private HashMap _params
A HashMap of parameters


_name

private String _name
This is the friendly identifier of the component this class is running in. eg, a Filter may be called "filter1", If this class does not have an owning component, a name from the configuration can be placed here. This name could also be changed to null for utility classes.

Constructor Detail

XMLPacket

public XMLPacket()
Method Detail

addParam

public void addParam(String key,
                     String value)
Add a key and value pair to the HashMap.

Parameters:
key - The key value
value - The value associated with the key

getParam

public String getParam(String key)
Return the value associated with a particular key. Returns null if the key does not exist, although this should not necessarily indicate that the key does not exist.

Parameters:
key - The key to retrieve
Returns:
The value associated with the key, if one exists, otherwise null.

getSet

public Set getSet()
Return a Set of the keys in the HashMap.

Returns:
a Set of the values in this Packet.

containsKey

public boolean containsKey(String key)
Find if a particular key exists in the HashMap.

Parameters:
key - The key to check for
Returns:
whether the key exists

printAll

public String printAll()
Print out the entire HashMap. (Mainly for assisting debugging.)

Returns:
A String representation of the data in this Packet

toString

public String toString()
Overrides the Object.toString() method to provide clean logging (every class should have this). This uses the uk.org.iscream.cms.server.util.NameFormat class to format the toString()

Returns:
the name of this class and its CVS revision


Copyright © 2000-2003 i-scream. All Rights Reserved.