org.palo.api.ext.subsets
Class SubsetHandlerRegistry

java.lang.Object
  extended by org.palo.api.ext.subsets.SubsetHandlerRegistry

Deprecated. Legacy subsets are not supported anymore! Please use Dimension.getSubsetHandler() instead!

public class SubsetHandlerRegistry
extends java.lang.Object

A SubsetHandlerRegistry administers SubsetStateHandlers which are used to determine the visible Elements from a certain Subset and its SubsetState. A SubsetStateHandler should not be used directly to compute the visible elements. Instead the registry returns a SubsetHandler which provides convenience methods for this task.

The API provides three default SubsetStateHandlers which are registered already, namely:

  • FlatStateHandler which handles the FlatState
  • HierarchicalStateHandler which handles the HierarchicalState
  • RegExStateHandler which handles the RegExState

  • Here is a code snippet which shows an example usage of the SubsetHandlerRegistry

    ...
    SubsetHandlerRegistry handlerReg = SubsetHandlerRegistry.getInstance();
    //get visible elements for the currently active SubsetState
    Element[] visibleElements = handlerReg.getHandler(aSubset).getVisibleElements();
    //get visible elements for a certain SubsetState
    visibleElements = handlerReg.getHandler(aSubset,RegExState.ID).getVisibleElements();
    ...

    Version:
    $Id: SubsetHandlerRegistry.html,v 1.18 2009/07/09 11:01:46 ArndHouben Exp $

    Method Summary
     SubsetStateHandler[] getAllStateHandler()
              Deprecated. Returns all registered SubsetStateHandlers
     SubsetHandler getHandler(Subset subset)
              Deprecated. Returns the SubsetHandler for the given Subset.
     SubsetHandler getHandler(Subset subset, java.lang.String stateId)
              Deprecated. Returns the SubsetHandler for the given Subset and its SubsetState defined by the given id.
     SubsetHandler getHandler(Subset subset, SubsetState subsetState)
              Deprecated. Returns the SubsetHandler for the given SubsetState.
    static SubsetHandlerRegistry getInstance()
              Deprecated. Returns the sole registry instance
     SubsetStateHandler getStateHandler(java.lang.String stateId)
              Deprecated. Returns the internally used SubsetStateHandler which is registered under the given subset state id.
     void register(java.lang.String stateId, SubsetStateHandler handler)
              Deprecated. Registers the given handler for the SubsetState specified by given state id.
     
    Methods inherited from class java.lang.Object
    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Method Detail

    getInstance

    public static final SubsetHandlerRegistry getInstance()
    Deprecated. 
    Returns the sole registry instance

    Returns:

    getHandler

    public final SubsetHandler getHandler(Subset subset)
    Deprecated. 
    Returns the SubsetHandler for the given Subset. null is returned if no SubsetHandler could be found or if no active SubsetState is set.

    Parameters:
    subset - the Subset to create the handler for
    Returns:
    a SubsetHandler or null if no handler could be found

    getHandler

    public final SubsetHandler getHandler(Subset subset,
                                          SubsetState subsetState)
    Deprecated. 
    Returns the SubsetHandler for the given SubsetState. If no SubsetHandler could be found null is returned.

    Parameters:
    subset - the Subset to create the handler for
    subsetState - the SubsetState to use
    Returns:
    a SubsetHandler or null if no handler could be found

    getHandler

    public final SubsetHandler getHandler(Subset subset,
                                          java.lang.String stateId)
    Deprecated. 
    Returns the SubsetHandler for the given Subset and its SubsetState defined by the given id. If no SubsetHandler could be found null is returned.

    Parameters:
    subset - the Subset to create the handler for
    stateId - a valid subset state identifier
    Returns:
    a SubsetHandler or null if no handler could be found

    getStateHandler

    public final SubsetStateHandler getStateHandler(java.lang.String stateId)
    Deprecated. 
    Returns the internally used SubsetStateHandler which is registered under the given subset state id. Note: it is not recommended to use a SubsetStateHandler directly, rather utilize the provided getHandler(Subset) method.

    Parameters:
    stateId - as subset state id
    Returns:
    the corresponding subset state handler or null if no handler was registered for this state id.

    getAllStateHandler

    public final SubsetStateHandler[] getAllStateHandler()
    Deprecated. 
    Returns all registered SubsetStateHandlers

    Returns:

    register

    public final void register(java.lang.String stateId,
                               SubsetStateHandler handler)
    Deprecated. 
    Registers the given handler for the SubsetState specified by given state id.

    Parameters:
    id -
    handler -