org.datanucleus.jdo
Class LifecycleListenerForClass

java.lang.Object
  extended by org.datanucleus.jdo.LifecycleListenerForClass

public class LifecycleListenerForClass
extends java.lang.Object

Wrapper for a LifecycleListener for an array of classes. If the classes is null, applies to all classes.


Constructor Summary
LifecycleListenerForClass(javax.jdo.listener.InstanceLifecycleListener listener, java.lang.Class[] classes)
          Constructor.
 
Method Summary
 boolean forClass(java.lang.Class cls)
          Accessor for whether the listener supported the class.
 java.lang.Class[] getClasses()
          Accessor for the classes in this specification
 javax.jdo.listener.InstanceLifecycleListener getListener()
          Accessor for the listener for this specification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LifecycleListenerForClass

public LifecycleListenerForClass(javax.jdo.listener.InstanceLifecycleListener listener,
                                 java.lang.Class[] classes)
Constructor.

Parameters:
listener - The listener
classes - The classes supported by the listener
Method Detail

getListener

public javax.jdo.listener.InstanceLifecycleListener getListener()
Accessor for the listener for this specification

Returns:
The listener

getClasses

public java.lang.Class[] getClasses()
Accessor for the classes in this specification

Returns:
The classes

forClass

public boolean forClass(java.lang.Class cls)
Accessor for whether the listener supported the class. Actually checks if the passed class is a subclass of one of the listener classes.

Parameters:
cls - The class
Returns:
Whether it is supported


Copyright © 2010. All Rights Reserved.