org.nakedobjects.metamodel.util
Class ClassUtil

java.lang.Object
  extended by org.nakedobjects.metamodel.util.ClassUtil

public final class ClassUtil
extends java.lang.Object


Method Summary
static boolean directlyImplements(java.lang.Class<?> cls, java.lang.Class<?> interfaceType)
           
static java.lang.Class<?> implementingClassOrNull(java.lang.Class<?> classCandidate, java.lang.Class<?> requiredClass, java.lang.Class<?> constructorParamType)
          Returns the supplied Class so long as it implements (or is a subclass of) the required class, and also has either a constructor accepting the specified param type, or has a no-arg constructor.
static java.lang.Class<?> implementingClassOrNull(java.lang.String classCandidateName, java.lang.Class<?> requiredClass, java.lang.Class<?> constructorParamType)
           
static java.lang.Object newInstance(java.lang.Class<?> type, java.lang.Class<?>[] constructorParamTypes, java.lang.Object[] constructorArgs)
          Tries to instantiate using a constructor accepting the supplied arguments; if no such constructor then falls back to trying the no-arg constructor.
static java.lang.Object newInstance(java.lang.Class<?> type, java.lang.Class<?> constructorParamType, java.lang.Object constructorArg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static java.lang.Object newInstance(java.lang.Class<?> type,
                                           java.lang.Class<?> constructorParamType,
                                           java.lang.Object constructorArg)

newInstance

public static java.lang.Object newInstance(java.lang.Class<?> type,
                                           java.lang.Class<?>[] constructorParamTypes,
                                           java.lang.Object[] constructorArgs)
Tries to instantiate using a constructor accepting the supplied arguments; if no such constructor then falls back to trying the no-arg constructor.


implementingClassOrNull

public static java.lang.Class<?> implementingClassOrNull(java.lang.Class<?> classCandidate,
                                                         java.lang.Class<?> requiredClass,
                                                         java.lang.Class<?> constructorParamType)
Returns the supplied Class so long as it implements (or is a subclass of) the required class, and also has either a constructor accepting the specified param type, or has a no-arg constructor.


implementingClassOrNull

public static java.lang.Class<?> implementingClassOrNull(java.lang.String classCandidateName,
                                                         java.lang.Class<?> requiredClass,
                                                         java.lang.Class<?> constructorParamType)

directlyImplements

public static boolean directlyImplements(java.lang.Class<?> cls,
                                         java.lang.Class<?> interfaceType)


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.