org.trails.descriptor
Class TrailsDescriptorService

java.lang.Object
  extended by org.trails.descriptor.TrailsDescriptorService
All Implemented Interfaces:
DescriptorService

public class TrailsDescriptorService
extends java.lang.Object
implements DescriptorService

This class builds and caches IClassDescriptors. Descriptors are build during the init method which is called by Spring during application startup

Author:
cnelson
See Also:
IClassDescriptor

Field Summary
protected  java.util.Map<java.lang.Class,IClassDescriptor> descriptors
           
protected  java.util.List<java.lang.Class> types
           
 
Constructor Summary
TrailsDescriptorService()
           
 
Method Summary
protected  IClassDescriptor applyDecorators(IClassDescriptor descriptor)
          Have the decorators decorate this descriptor todo what are decorators for and/or why would I want to call this menthod?
protected  void findChildren(IClassDescriptor iClassDescriptor)
           
 java.util.List<IClassDescriptor> getAllDescriptors()
           
 IClassDescriptor getClassDescriptor(java.lang.Class type)
           
 java.util.List<DescriptorDecorator> getDecorators()
          In the default Trails configuration this will contain a HibernateDescriptorDecorator and an AnnotationDecorator
 DescriptorFactory getDescriptorFactory()
          In default Trails this will be a ReflectionDescriptorFactory
 java.util.List getTypes()
          In the Trails default configuration this will be set to all classes in the Hibernate config
 void init()
          For each class in types, a descriptor is built by the DescriptorFactory.
 void setDecorators(java.util.List<DescriptorDecorator> decorators)
           
 void setDescriptorFactory(DescriptorFactory descriptorFactory)
           
 void setTypes(java.util.List<java.lang.Class> types)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

types

protected java.util.List<java.lang.Class> types

descriptors

protected java.util.Map<java.lang.Class,IClassDescriptor> descriptors
Constructor Detail

TrailsDescriptorService

public TrailsDescriptorService()
Method Detail

init

public void init()
          throws ognl.OgnlException
For each class in types, a descriptor is built by the DescriptorFactory. Next it is decorated by each DescriptorDecorator in turn. Finally it is cached.

Throws:
ognl.OgnlException
See Also:
DescriptorFactory, DescriptorDecorator

getAllDescriptors

public java.util.List<IClassDescriptor> getAllDescriptors()
Specified by:
getAllDescriptors in interface DescriptorService

getClassDescriptor

public IClassDescriptor getClassDescriptor(java.lang.Class type)
Specified by:
getClassDescriptor in interface DescriptorService

findChildren

protected void findChildren(IClassDescriptor iClassDescriptor)

applyDecorators

protected IClassDescriptor applyDecorators(IClassDescriptor descriptor)
Have the decorators decorate this descriptor todo what are decorators for and/or why would I want to call this menthod?

Parameters:
descriptor -
Returns:
The resulting descriptor after all decorators are applied

getTypes

public java.util.List getTypes()
In the Trails default configuration this will be set to all classes in the Hibernate config

Returns:

setTypes

public void setTypes(java.util.List<java.lang.Class> types)
Parameters:
types - all the classes this service should describe

getDecorators

public java.util.List<DescriptorDecorator> getDecorators()
In the default Trails configuration this will contain a HibernateDescriptorDecorator and an AnnotationDecorator

Returns:
See Also:
org.trails.hibernate.HibernateDescriptorDecorator, AnnotationDecorator

setDecorators

public void setDecorators(java.util.List<DescriptorDecorator> decorators)
Specified by:
setDecorators in interface DescriptorService

getDescriptorFactory

public DescriptorFactory getDescriptorFactory()
In default Trails this will be a ReflectionDescriptorFactory

Returns:
See Also:
ReflectionDescriptorFactory

setDescriptorFactory

public void setDescriptorFactory(DescriptorFactory descriptorFactory)


Copyright © 2004-2008. All Rights Reserved.