org.codehaus.activesoap.handler
Class DefaultHandlerRegistry

java.lang.Object
  extended byorg.codehaus.activesoap.handler.DefaultHandlerRegistry
All Implemented Interfaces:
HandlerRegistry
Direct Known Subclasses:
StaxHandlerRegistry, XMLBeansRegistry, XStreamRegistry

public class DefaultHandlerRegistry
extends Object
implements HandlerRegistry

Provides a registry of handlers indexed by specific QName instances as well as providing a default handler which is used for processing SOAP body elements (or REST root elements) if no QName could be matched.

Version:
$Revision: 1.1 $

Constructor Summary
DefaultHandlerRegistry()
           
DefaultHandlerRegistry(Handler defaultHandler)
           
 
Method Summary
 void addHandler(QName name, Handler handler)
          Adds a new handler for the given QName
 void addHandler(String[] namespaceURIs, Handler handler)
          Adds a new handle to a number of different namespace URIs (typically to handle multiple version URIs for the same handler)
 void addHandler(String namepaceURI, Handler handler)
          Adds a new handler for the given namespace URI
 Handler getBodyHandler()
          Returns the handler that should be used to process the body elements which by default will be a QNameHandler which delegates to the handler for the current QName otherwise using the handler returned by getDefaultHandler()
 Handler getDefaultHandler()
          Returns the default handler which is used when processing body elements which have no QName matching handler.
 Handler getHandler(QName name)
          Returns the handler bound to the given QName or null if no handler is bound to this name
protected  Map getHandlers()
          Provide implementations with direct access to the handler map
 Handler removeHandler(QName name)
          Removes the handler associated with the given QName
 Handler removeHandler(String namepaceURI)
          Removes the handler associated with the given namespace URI
 void removeHandler(String[] namespaceURIs, Handler handler)
          Removes a handler from a number of different namespace URIs (typically to handle multiple version URIs for the same handler)
 Handler removeHandler(String namepaceURI, Handler handler)
          Removes the handler associated with the given namespace URI
 void setBodyHandler(Handler bodyHandler)
          Sets the handler used to process body elements
 void setDefaultHandler(Handler defaultHandler)
          Sets the default handler used to process body elements if no handlers are found for a given QName
protected  void setHandlers(Map handlers)
          Provide implementations with direct access to the handler map
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHandlerRegistry

public DefaultHandlerRegistry()

DefaultHandlerRegistry

public DefaultHandlerRegistry(Handler defaultHandler)
Method Detail

getHandler

public Handler getHandler(QName name)
Description copied from interface: HandlerRegistry
Returns the handler bound to the given QName or null if no handler is bound to this name

Specified by:
getHandler in interface HandlerRegistry
Parameters:
name - the name of the element to lookup the handler for
Returns:
the handler bound to the name or null if none is bound

addHandler

public void addHandler(String namepaceURI,
                       Handler handler)
Description copied from interface: HandlerRegistry
Adds a new handler for the given namespace URI

Specified by:
addHandler in interface HandlerRegistry
Parameters:
namepaceURI -
handler -

addHandler

public void addHandler(String[] namespaceURIs,
                       Handler handler)
Description copied from interface: HandlerRegistry
Adds a new handle to a number of different namespace URIs (typically to handle multiple version URIs for the same handler)

Specified by:
addHandler in interface HandlerRegistry
Parameters:
namespaceURIs -
handler -

removeHandler

public void removeHandler(String[] namespaceURIs,
                          Handler handler)
Description copied from interface: HandlerRegistry
Removes a handler from a number of different namespace URIs (typically to handle multiple version URIs for the same handler)

Specified by:
removeHandler in interface HandlerRegistry
Parameters:
namespaceURIs -
handler -

addHandler

public void addHandler(QName name,
                       Handler handler)
Description copied from interface: HandlerRegistry
Adds a new handler for the given QName

Specified by:
addHandler in interface HandlerRegistry
Parameters:
name -
handler -

removeHandler

public Handler removeHandler(QName name)
Description copied from interface: HandlerRegistry
Removes the handler associated with the given QName

Specified by:
removeHandler in interface HandlerRegistry
Parameters:
name -
Returns:

removeHandler

public Handler removeHandler(String namepaceURI)
Description copied from interface: HandlerRegistry
Removes the handler associated with the given namespace URI

Specified by:
removeHandler in interface HandlerRegistry
Parameters:
namepaceURI -

removeHandler

public Handler removeHandler(String namepaceURI,
                             Handler handler)
Description copied from interface: HandlerRegistry
Removes the handler associated with the given namespace URI

Specified by:
removeHandler in interface HandlerRegistry
Parameters:
namepaceURI -

getBodyHandler

public Handler getBodyHandler()
Description copied from interface: HandlerRegistry
Returns the handler that should be used to process the body elements which by default will be a QNameHandler which delegates to the handler for the current QName otherwise using the handler returned by HandlerRegistry.getDefaultHandler()

Specified by:
getBodyHandler in interface HandlerRegistry

setBodyHandler

public void setBodyHandler(Handler bodyHandler)
Description copied from interface: HandlerRegistry
Sets the handler used to process body elements

Specified by:
setBodyHandler in interface HandlerRegistry
Parameters:
bodyHandler - the new handler used to process body elements

getDefaultHandler

public Handler getDefaultHandler()
Description copied from interface: HandlerRegistry
Returns the default handler which is used when processing body elements which have no QName matching handler.

Specified by:
getDefaultHandler in interface HandlerRegistry

setDefaultHandler

public void setDefaultHandler(Handler defaultHandler)
Description copied from interface: HandlerRegistry
Sets the default handler used to process body elements if no handlers are found for a given QName

Specified by:
setDefaultHandler in interface HandlerRegistry

getHandlers

protected Map getHandlers()
Provide implementations with direct access to the handler map


setHandlers

protected void setHandlers(Map handlers)
Provide implementations with direct access to the handler map



Copyright © 2004-2007 LogicBlaze, Inc.. All Rights Reserved.