com.collation.platform.model
Class InterfaceIntrospector

java.lang.Object
  extended by com.collation.platform.model.InterfaceIntrospector

public class InterfaceIntrospector
extends java.lang.Object

Java Bean Introspector for ModelObject interfaces.


Field Summary
protected static com.collation.platform.logger.Logger log_
           
 
Constructor Summary
InterfaceIntrospector()
           
 
Method Summary
static java.util.Set getBaseInterfaces(java.lang.Class cls)
           
static java.lang.String getCollationSubtype(ModelObject obj)
          Returns the Collation subtype of the given ModelObject
static java.lang.String getCollationType(ModelObject obj)
          Returns the Collation type of the given ModelObject
static java.lang.Class getModelObjectInterface(java.lang.Class cls)
          Returns a subclass of the ModelObject interface that is implemented by the given class.
static java.lang.Class getModelObjectInterface(java.lang.Object obj)
          Returns a subclass of the ModelObject interface that is implemented by the given object.
static java.util.Set getModelObjectInterfaces(java.lang.Class cls)
          Returns a set of ModelObject interface that is implemented by or is a base class of an interface implemented by the given class.
static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class cls)
          Returns an array of PropertyDescriptors that the given class implements.
static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class cls, java.lang.Class baseCls)
          Returns an array of PropertyDescriptors that the given class implements.
static boolean hasCollationSubtype(ModelObject obj)
          Returns true if the given ModelObject has a Collation subtype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log_

protected static final com.collation.platform.logger.Logger log_
Constructor Detail

InterfaceIntrospector

public InterfaceIntrospector()
Method Detail

getModelObjectInterface

public static java.lang.Class getModelObjectInterface(java.lang.Object obj)
Returns a subclass of the ModelObject interface that is implemented by the given object. Assumes the object implements one and only one such interface.

Parameters:
obj - the object to be inspected
Returns:
the class object for the interface, or null if the object does not implement any such interface

getModelObjectInterface

public static java.lang.Class getModelObjectInterface(java.lang.Class cls)
Returns a subclass of the ModelObject interface that is implemented by the given class. Assumes the class implements one and only one such interface.

Parameters:
cls - the class to be inspected
Returns:
the class object for the interface, or null if the class does not implement any such interface

getModelObjectInterfaces

public static java.util.Set getModelObjectInterfaces(java.lang.Class cls)
Returns a set of ModelObject interface that is implemented by or is a base class of an interface implemented by the given class.

Parameters:
cls - the class to be inspected
Returns:
the set of interfaces

getBaseInterfaces

public static java.util.Set getBaseInterfaces(java.lang.Class cls)

getCollationType

public static java.lang.String getCollationType(ModelObject obj)
Returns the Collation type of the given ModelObject

Parameters:
obj - the object
Returns:
the Collation type

hasCollationSubtype

public static boolean hasCollationSubtype(ModelObject obj)
Returns true if the given ModelObject has a Collation subtype

Parameters:
obj - the object
Returns:

getCollationSubtype

public static java.lang.String getCollationSubtype(ModelObject obj)
Returns the Collation subtype of the given ModelObject

Parameters:
obj - the object
Returns:
the Collation subtype

getPropertyDescriptors

public static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class cls)
                                                              throws java.beans.IntrospectionException
Returns an array of PropertyDescriptors that the given class implements.

Parameters:
cls - the class to be inspected
Returns:
the array of PropertyDescriptors
Throws:
java.beans.IntrospectionException

getPropertyDescriptors

public static java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Class cls,
                                                                     java.lang.Class baseCls)
                                                              throws java.beans.IntrospectionException
Returns an array of PropertyDescriptors that the given class implements. Include all super classes, up to the given class.

Parameters:
cls - the class to be inspected
Returns:
the array of PropertyDescriptors
Throws:
java.beans.IntrospectionException