nenok
Class Utilities

java.lang.Object
  extended by nenok.Utilities

public class Utilities
extends Object

Utility class that provides a collection of static methods which extend the java reflection framework.

Version:
$LastChangedRevision: 550 $
$LastChangedDate: 2008-03-26 14:14:27 +0100 (Mi, 26 Mrz 2008) $
Author:
Marc Pouly

Constructor Summary
Utilities()
           
 
Method Summary
static List<Method> getRepresentators(Valuation val)
          This static method returns a list of all representators defined in the argument's class.
static boolean interfaceOf(Class _interface, Class _class)
          Helper method to determine if a given class implements a given interface.
static boolean superclassOf(Class _super, Class _class)
          Helper method to determine if a given class is superclass of another.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utilities

public Utilities()
Method Detail

interfaceOf

public static boolean interfaceOf(Class _interface,
                                  Class _class)
Helper method to determine if a given class implements a given interface.

Parameters:
_interface - Is this interface implemented by the given class.
_class - Does this class implement the given interface.
Returns:
true, if the given class implements the given interface.

superclassOf

public static boolean superclassOf(Class _super,
                                   Class _class)
Helper method to determine if a given class is superclass of another. Convention: Every class is superclass of itself.

Parameters:
_super - Is this class ascendent of the second argument.
_class - Is this class descendent of the former argument.
Returns:
true, if the first argument is a superclass of the second.

getRepresentators

public static List<Method> getRepresentators(Valuation val)
This static method returns a list of all representators defined in the argument's class. Representator methods are annotated with Representor.

Parameters:
val - The valuation class instance to be searched.
Returns:
All representators contained in the argument's class.