SRJRCFrames
v0.1.296

de.schwarzrot.data.access.support
Class EntityIntrospector

java.lang.Object
  extended by de.schwarzrot.data.access.support.EntityIntrospector
Direct Known Subclasses:
JDBCEntityIntrospector, PreferencesEntityIntrospector

public class EntityIntrospector
extends Object

base class to storage dependant introspection. It acts like a decorator factory, which by default returns an EntityDescriptor. That EntityDescriptor does the introspection of the java class and this EntityIntrospector changes that information to match the physical datastorage information needs.

This implementation applies defined mappings to physical names and offers dedicated calls for subclasses to add their informations.

Author:
Reinhard Mantey

Constructor Summary
EntityIntrospector()
           
 
Method Summary
 void dumpCache()
           
 EntityDescriptor getEntityDescriptor(Class<?> entityType, Object handle)
          ensures that entity introspection will happen only once in the lifetime of the application.
protected  org.apache.commons.logging.Log getLogger()
           
protected  String getMapped(String propertyName)
          callback to extend introspection.
protected  void initForDescriptor(EntityDescriptor ed, Object handle)
          empty callback for subclasses to extend introspection.
protected  void patchPropertyInfo(PropertyInfo info, EntityDescriptor ed)
          callback to extend/change introspection.
protected  void validate(EntityDescriptor ed, Object handle)
          empty callback for subclasses to extend introspection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityIntrospector

public EntityIntrospector()
Method Detail

dumpCache

public void dumpCache()

getEntityDescriptor

public final EntityDescriptor getEntityDescriptor(Class<?> entityType,
                                                  Object handle)
ensures that entity introspection will happen only once in the lifetime of the application. Offers empty calls for subclasses to change or extend the collected informations as needed.

Parameters:
entityType - the entity to introspect
handle - abstraction of an connection handle, in case physical data storage needs to do some extra investigation
Returns:
the Descriptor already found from Catalog or a freshly investigated Descriptor

getLogger

protected final org.apache.commons.logging.Log getLogger()

getMapped

protected String getMapped(String propertyName)
callback to extend introspection. Will be called for properties, that don't have a mapping entry, so this call is to generate the physical name from property name. Default implementation returns just the property name unchanged.

Parameters:
propertyName - the logical property name
Returns:
the properties name for physical data storage

initForDescriptor

protected void initForDescriptor(EntityDescriptor ed,
                                 Object handle)
empty callback for subclasses to extend introspection. Will be called before walking over all collected PropertyInfo entries.

Parameters:
ed - the freshly created EntityDescriptor
handle - abstraction of an connection handle, in case physical data storage needs to do some extra investigation

patchPropertyInfo

protected void patchPropertyInfo(PropertyInfo info,
                                 EntityDescriptor ed)
callback to extend/change introspection. Default behaviour is to set all properties, that don't have an entry in skiplist, to being persistent.

Parameters:
info - the collected PropertyInfo
ed - the EntityDescriptor holding the PropertyInfo entry

validate

protected void validate(EntityDescriptor ed,
                        Object handle)
empty callback for subclasses to extend introspection. Will be called after the loop over all collected PropertyInfo entries.

Parameters:
ed - the EntityDescriptor to extend
handle - abstraction of an connection handle, in case physical data storage needs to do some extra investigation

SRJRCFrames
v0.1.296

hosted at
Find SRJRCFrames at SourceForge.net. Fast, secure and free:
           Open Source Software download
Submit a bug or request a feature

SRJRCFrames is published according to the GNU General Public License
Copyright 2005-2012 Reinhard Mantey - some rights reserved.