View Javadoc

1   /*
2    * Created on May 27, 2005
3    *
4    * TODO To change the template for this generated file go to
5    * Window - Preferences - Java - Code Style - Code Templates
6    */
7   package net.sf.tlc.core.impl;
8   
9   import net.sf.tlc.core.LifecycleAware;
10  import net.sf.tlc.util.ClassUtils;
11  
12  /***
13   * TODO change the description of FinderHelper
14   * 
15   * @author aisrael
16   */
17  public final class FinderHelper {
18  
19      /***
20       *  
21       */
22      private FinderHelper() {
23          // noop
24      }
25  
26      /***
27       * A valid target is a concrete class (not an abstract class and not an
28       * interface) which implements Runnable.
29       * 
30       * @param c
31       *            Class
32       * @return true if the given Class is a valid Target
33       */
34      public static boolean isTargetClass(final Class c) {
35          return !(ClassUtils.isAbstractClass(c) || c.isInterface())
36                  && (ClassUtils.isRunnable(c) || LifecycleAware.class.isAssignableFrom(c));
37      }
38  
39  }