net.sf.morph.util
Class ReflectorUtils

java.lang.Object
  extended by net.sf.morph.util.ReflectorUtils

public abstract class ReflectorUtils
extends java.lang.Object

Utility functions useful for implementing and interacting with Reflectors.

Since:
Nov 26, 2004
Author:
Matt Sgarlata

Constructor Summary
ReflectorUtils()
           
 
Method Summary
static boolean isReflectable(Reflector reflector, java.lang.Class reflectedType, java.lang.Class reflectorType)
          Indicates whether the given reflector can support the operations specified in reflectorType when reflecting instances of reflectedType.
static boolean isReflectable(Reflector reflector, java.lang.Object reflectedObject, java.lang.Class reflectorType)
          Indicates whether the given reflector can support the operations specified in reflectorType when reflecting reflectedObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectorUtils

public ReflectorUtils()
Method Detail

isReflectable

public static boolean isReflectable(Reflector reflector,
                                    java.lang.Class reflectedType,
                                    java.lang.Class reflectorType)
                             throws java.lang.IllegalArgumentException
Indicates whether the given reflector can support the operations specified in reflectorType when reflecting instances of reflectedType.

Parameters:
reflector - the reflector
reflectedType - the type of the object for which we wish to determine reflectability
reflectorType - the interface which defines the operations we would like to perform on instances of reflectedType
Returns:
true, if the given reflector can support the operations specified in reflectorType when reflecting instances of reflectedType
Throws:
java.lang.IllegalArgumentException - if any of the arguments to this function are null
ReflectionException - if reflectability could not be determined

isReflectable

public static boolean isReflectable(Reflector reflector,
                                    java.lang.Object reflectedObject,
                                    java.lang.Class reflectorType)
Indicates whether the given reflector can support the operations specified in reflectorType when reflecting reflectedObject.

Parameters:
reflector - the reflector
reflectedObject - the object for which we wish to determine reflectability
reflectorType - the interface which defines the operations we would like to perform on instances of reflectedType
Returns:
true, if the given reflector can support the operations specified in reflectorType when reflecting instances of reflectedType
Throws:
java.lang.IllegalArgumentException - if any of the arguments to this function are null
ReflectionException - if reflectability could not be determined
Since:
Morph 1.1


Copyright © 2004-2008.