net.sourceforge.servletspy.handler.base
Class AbstractClassFilter

java.lang.Object
  extended bynet.sourceforge.servletspy.handler.base.AbstractClassFilter
All Implemented Interfaces:
IContextHandler, ILifecycle
Direct Known Subclasses:
ClassFilter

public abstract class AbstractClassFilter
extends java.lang.Object
implements IContextHandler

AbstractClassFilter prevents passing of subjects to the next IContextHandler in case they are assignable to an element of a set of classes and interfaces. In this case a string representation of the subject is created.

Author:
arno schumacher

Field Summary
protected  java.util.List clazzes
          The list of classes to exclude.
static java.lang.String PARAM_CLASSES
          Configuration parameter name used to pass a list of space separated class names to exclude.
 
Constructor Summary
protected AbstractClassFilter(java.lang.String classesString)
          Constructor.
protected AbstractClassFilter(java.lang.String[] clazzArray)
          Constructor.
 
Method Summary
 void destroy()
           
protected static java.util.List fromString(java.lang.String clazzes)
          Generates a list of java.lang.Class objects using the a space seaparated list of class names.
 void handle(IContext context)
          The handle method of the IContextHandler is called by the engine each time a subject object should be serialized.
 void init(Param[] params)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_CLASSES

public static final java.lang.String PARAM_CLASSES
Configuration parameter name used to pass a list of space separated class names to exclude.

See Also:
Constant Field Values

clazzes

protected final java.util.List clazzes
The list of classes to exclude.

Constructor Detail

AbstractClassFilter

protected AbstractClassFilter(java.lang.String classesString)
Constructor.

Parameters:
classesString - a string holding a space separated list of qualified class or interface names to filter out.

AbstractClassFilter

protected AbstractClassFilter(java.lang.String[] clazzArray)
Constructor.

Parameters:
clazzArray - a string array holding qualified class or interface names to filter out.
Method Detail

fromString

protected static java.util.List fromString(java.lang.String clazzes)
Generates a list of java.lang.Class objects using the a space seaparated list of class names.

Parameters:
clazzes - The classes as string.
Returns:
A list of java.lang.Class objects.

destroy

public void destroy()
Specified by:
destroy in interface ILifecycle

handle

public final void handle(IContext context)
                  throws java.lang.Exception
Description copied from interface: IContextHandler
The handle method of the IContextHandler is called by the engine each time a subject object should be serialized. The IContextHandler may do the serialization itself using the operations provided by the IContext or pass the serialization task to the next IContextHandler by calling the proceed method on the IContext object.

Specified by:
handle in interface IContextHandler
Parameters:
context - The current serialization context
Throws:
java.lang.Exception - To signal serialization problems

init

public final void init(Param[] params)
Specified by:
init in interface ILifecycle
Parameters:
params - may hold an entries with the key CLASSES holding a space separated list of qualified class or interface names to filter out.


Copyright 2005-2005-2006 Arno Schumacher. All Rights Reserved.