org.jabber.jabberbeans.sax
Class HandlerEntry

java.lang.Object
  |
  +--org.jabber.jabberbeans.sax.HandlerEntry

public class HandlerEntry
extends java.lang.Object

Each instance of this class is responsible for handling a single XML namesapce, or element type, All packet and extension types are represented by SubHandlers, and each subhandler per connection has an HandlerEntry.


Constructor Summary
HandlerEntry(java.lang.String propPrefix, java.lang.String xmlns, java.lang.String element)
          Creates a new HandlerEntry instance.
 
Method Summary
 java.lang.String getBuilder()
          get the name of the class which is used to build instances of the product
 java.lang.String getDescription()
          get the textual description of what this element or namespace is used for
 java.lang.String getElement()
          gets the element associated with this entry, if any
 java.lang.String getHandler()
          get the name of the handler which is used to process XML and create instances of the product
 SubHandler getHandlerClass()
          get an instance of the handler for this entry - if none exists so far, one will be instantiated.
 java.lang.String getPrefix()
          get the Prefix associated with this entry in the .properties file
 java.lang.String getProduct()
          get the name of the class which is the product of the builder and handler, if only one class is the result
 java.lang.String getXMLNS()
          gets the XML namespace of associated with this entry, if any
 int hashCode()
          returns a hash value for entry into a HashTable
 SubHandler newInstance()
          creates a new instance of the handler for this entry, independant of the internal one-item cache.
 void setBuilder(java.lang.String b)
          set the name of the class which is used to build instances of the product
 void setDescription(java.lang.String desc)
          set the textual description of what this element or namespace is used for
 void setHandler(java.lang.String handler)
          set the name of the handler which is used to process XML and create instances of the product
 void setProduct(java.lang.String product)
          set the name of the class which is the product of the builder and handler, if only one class is the result
 java.lang.String toString()
          used to output a debug of the data in the Entry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HandlerEntry

public HandlerEntry(java.lang.String propPrefix,
                    java.lang.String xmlns,
                    java.lang.String element)
Creates a new HandlerEntry instance.

Parameters:
propPrefix - a String with the prefix in the .properties file
xmlns - a String with the XML namespace of the element, if any.
element - a String with the element name, if any
Method Detail

toString

public java.lang.String toString()
used to output a debug of the data in the Entry

Overrides:
toString in class java.lang.Object
Returns:
String with some data on this Entry

hashCode

public int hashCode()
returns a hash value for entry into a HashTable

Overrides:
hashCode in class java.lang.Object
Returns:
int hash value

getXMLNS

public java.lang.String getXMLNS()
gets the XML namespace of associated with this entry, if any

Returns:
a String value, or null if no namespace

getElement

public java.lang.String getElement()
gets the element associated with this entry, if any

Returns:
a String value, or null if no element

getPrefix

public java.lang.String getPrefix()
get the Prefix associated with this entry in the .properties file

Returns:
a String value

getBuilder

public java.lang.String getBuilder()
get the name of the class which is used to build instances of the product

Returns:
a String value, or null if none needed

setBuilder

public void setBuilder(java.lang.String b)
set the name of the class which is used to build instances of the product

Parameters:
b - a String value, or null if none needed

getHandler

public java.lang.String getHandler()
get the name of the handler which is used to process XML and create instances of the product

Returns:
a String value

setHandler

public void setHandler(java.lang.String handler)
set the name of the handler which is used to process XML and create instances of the product

Parameters:
handler - a String value

getProduct

public java.lang.String getProduct()
get the name of the class which is the product of the builder and handler, if only one class is the result

Returns:
a String value, or null if more than one possible

setProduct

public void setProduct(java.lang.String product)
set the name of the class which is the product of the builder and handler, if only one class is the result

Parameters:
product - a String value, or null if more than one possible

getDescription

public java.lang.String getDescription()
get the textual description of what this element or namespace is used for

Returns:
a String description

setDescription

public void setDescription(java.lang.String desc)
set the textual description of what this element or namespace is used for

Parameters:
desc - a String description

getHandlerClass

public SubHandler getHandlerClass()
                           throws java.lang.ClassNotFoundException,
                                  java.lang.InstantiationException,
                                  java.lang.IllegalAccessException
get an instance of the handler for this entry - if none exists so far, one will be instantiated. Note that you will need to create a new instance if you are going to do something like handle the same type of tag twice.

Returns:
a SubHandler value
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if there is a problem creating the class
java.lang.IllegalAccessException - if there is an access problem with the class (such as it not being declared public)

newInstance

public SubHandler newInstance()
                       throws java.lang.ClassNotFoundException,
                              java.lang.InstantiationException,
                              java.lang.IllegalAccessException
creates a new instance of the handler for this entry, independant of the internal one-item cache.

Returns:
a new SubHandler
Throws:
java.lang.ClassNotFoundException - if the class does not exist
java.lang.InstantiationException - if there is a problem creating the class
java.lang.IllegalAccessException - if there is an access problem with the class (such as it not being declared public)