net.sf.mmm.util.reflect.base
Class AssignableFromFilter

java.lang.Object
  extended by net.sf.mmm.util.reflect.base.AssignableFromFilter
All Implemented Interfaces:
Filter<Class<?>>

public class AssignableFromFilter
extends Object
implements Filter<Class<?>>

This is a filter that only accepts types that are assignable from a special type.

Since:
1.0.1
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  Class<?> superClass
          The class
 
Constructor Summary
AssignableFromFilter(Class<?> superType)
          The constructor.
 
Method Summary
 boolean accept(Class<?> type)
          This method determines if the given value should be accepted.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

superClass

private final Class<?> superClass
The class

Constructor Detail

AssignableFromFilter

public AssignableFromFilter(Class<?> superType)
The constructor.

Parameters:
superType - is the super-type defining which types to accept.
Method Detail

accept

public boolean accept(Class<?> type)
This method determines if the given value should be accepted.

Specified by:
accept in interface Filter<Class<?>>
Parameters:
type - is the value to check.
Returns:
true if and only if the given type is assignable from the super-type defined at construction. This means the given type has to implement/extend the super-type or be equal to it.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.