com.jabberwookie
Class Namespaces

java.lang.Object
  |
  +--com.jabberwookie.Namespaces

public class Namespaces
extends java.lang.Object

This class handles the maping of Jabber namespaces to Java classes. By default it will load a maping that understands all the classes implemented in the com.jabberwookie.ns.jabber.* heirarchy.

Author:
smeiners

Field Summary
protected static java.lang.String DEFAULT_NAMESPACES
           
protected  java.util.Hashtable nsTable
           
 
Constructor Summary
Namespaces()
          Creates a new instance of Namespaces with just the default mapings.
Namespaces(java.util.Hashtable customNamespaces)
          Creates a new instance of Namespaces with the default mapings as well as any custom namespace mapings you pass.
 
Method Summary
 XMLElement getElement(java.lang.String namespace, java.lang.String tag)
          Returns a class that knows how to interpret the given namespace.
protected static java.lang.Class loadClass(java.lang.String className)
          Loads the given class by name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAMESPACES

protected static final java.lang.String DEFAULT_NAMESPACES
See Also:
Constant Field Values

nsTable

protected final java.util.Hashtable nsTable
Constructor Detail

Namespaces

public Namespaces()
Creates a new instance of Namespaces with just the default mapings.


Namespaces

public Namespaces(java.util.Hashtable customNamespaces)
Creates a new instance of Namespaces with the default mapings as well as any custom namespace mapings you pass. Note: your mapings will override the defaults if the names match.

Parameters:
customNamespaces - The namespace mapings in the form of key = <namespace>, value = <class name>. Please note that all namespace classes must inherit from the com.ssttr.xml.XMLElement class.
Method Detail

getElement

public XMLElement getElement(java.lang.String namespace,
                             java.lang.String tag)
Returns a class that knows how to interpret the given namespace.

Parameters:
namespace -
tag -
Returns:

loadClass

protected static java.lang.Class loadClass(java.lang.String className)
Loads the given class by name.