org.trails.descriptor
Class ReflectionDescriptorFactory

java.lang.Object
  extended by org.trails.descriptor.ReflectionDescriptorFactory
All Implemented Interfaces:
DescriptorFactory

public class ReflectionDescriptorFactory
extends java.lang.Object
implements DescriptorFactory

Generate descriptors using reflection on the underlying class. ReflectionDescriptorFactory.buildClassDescriptor() is the only public method here.


Field Summary
protected static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
ReflectionDescriptorFactory()
           
 
Method Summary
 IClassDescriptor buildClassDescriptor(java.lang.Class type)
          Given a type, build a property descriptor
protected  java.util.ArrayList<IMethodDescriptor> buildMethodDescriptors(java.lang.Class type, java.beans.BeanInfo beanInfo, IClassDescriptor parentClassDescriptor)
           
protected  java.util.ArrayList<IPropertyDescriptor> buildPropertyDescriptors(java.lang.Class beanType, java.beans.BeanInfo beanInfo, IClassDescriptor parentClassDescriptor)
          Build the set of property descriptors for this type
 java.util.List getMethodExcludes()
           
 java.util.List getPropertyExcludes()
           
protected  boolean isExcluded(java.lang.String name, java.util.List excludes)
           
 void setMethodExcludes(java.util.List methodExcludes)
           
 void setPropertyExcludes(java.util.List propertyExcludes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
Constructor Detail

ReflectionDescriptorFactory

public ReflectionDescriptorFactory()
Method Detail

buildClassDescriptor

public IClassDescriptor buildClassDescriptor(java.lang.Class type)
Given a type, build a property descriptor

Specified by:
buildClassDescriptor in interface DescriptorFactory
Parameters:
type - The type to build for
Returns:
a completed property descriptor

buildPropertyDescriptors

protected java.util.ArrayList<IPropertyDescriptor> buildPropertyDescriptors(java.lang.Class beanType,
                                                                            java.beans.BeanInfo beanInfo,
                                                                            IClassDescriptor parentClassDescriptor)
                                                                     throws java.lang.Exception
Build the set of property descriptors for this type

Parameters:
beanType - the aggregating class
beanInfo - the BeanInfo, already gathered
parentClassDescriptor - reference to the aggregating class, used for recovery with graph traversal
Returns:
ObjectReferenceDescriptor if this property is an association, otherwise a TrailsPropertyDescriptor
Throws:
java.lang.Exception

buildMethodDescriptors

protected java.util.ArrayList<IMethodDescriptor> buildMethodDescriptors(java.lang.Class type,
                                                                        java.beans.BeanInfo beanInfo,
                                                                        IClassDescriptor parentClassDescriptor)
                                                                 throws java.lang.Exception
Throws:
java.lang.Exception

isExcluded

protected boolean isExcluded(java.lang.String name,
                             java.util.List excludes)

getMethodExcludes

public java.util.List getMethodExcludes()

setMethodExcludes

public void setMethodExcludes(java.util.List methodExcludes)
Specified by:
setMethodExcludes in interface DescriptorFactory

getPropertyExcludes

public java.util.List getPropertyExcludes()

setPropertyExcludes

public void setPropertyExcludes(java.util.List propertyExcludes)
Specified by:
setPropertyExcludes in interface DescriptorFactory


Copyright © 2004-2008. All Rights Reserved.