com.bm.introspectors
Class AbstractPersistentClassIntrospector<T>

java.lang.Object
  extended by com.bm.introspectors.AbstractPersistentClassIntrospector<T>
Type Parameters:
T - - the type of the class to inspect
All Implemented Interfaces:
Introspector<T>
Direct Known Subclasses:
EmbeddedClassIntrospector, EntityBeanIntrospector

public abstract class AbstractPersistentClassIntrospector<T>
extends java.lang.Object
implements Introspector<T>

This class implements the common methods for all concrete inspectors.

Since:
07.10.2005
Author:
Daniel Wiese

Field Summary
protected  java.util.Map<Property,PersistentPropertyInfo> fieldInfo
          holds the meta information for persistent fields *
protected  java.util.Map<Property,PrimaryKeyInfo> pkFieldInfo
          holds the meta information for primary key fields *
 
Constructor Summary
AbstractPersistentClassIntrospector()
           
 
Method Summary
protected  void extractGenerator(java.lang.annotation.Annotation[] propertyAnnotations, PrimaryKeyInfo info)
           
 java.lang.Object getField(T instance, Property toGet)
          Returns a value of an field.
protected abstract  org.apache.log4j.Logger getLogger()
          Returns the logger for this class.
 java.util.List<Property> getPersitentProperties()
          Returns the persistent fields.
 java.util.Set<Property> getPkFields()
          Return the primary key fields.
 PersistentPropertyInfo getPresistentFieldInfo(Property toCheck)
          This method returns informations about a persistent field.
 PrimaryKeyInfo getPrimaryKeyInfo(Property toCheck)
          This method returns informations about a persistent field.
 java.lang.Class<T> getRepresentingClass()
          Returns the representingClass.
 java.util.List<Property> getTransientFields()
          Returns the transientFields.
protected  void processAccessTypeField(java.lang.Class<T> toInspect)
          If the access type is field, we will extract all the necessary meta informations form the fields
protected  void processAccessTypeProperty(java.lang.Class<T> toInspect)
          If the access type is property, we will extract all the necessary meta informations form the getter methods
 void setField(T instance, Property toSet, java.lang.Object value)
          Sets a value of the field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldInfo

protected final java.util.Map<Property,PersistentPropertyInfo> fieldInfo
holds the meta information for persistent fields *


pkFieldInfo

protected final java.util.Map<Property,PrimaryKeyInfo> pkFieldInfo
holds the meta information for primary key fields *

Constructor Detail

AbstractPersistentClassIntrospector

public AbstractPersistentClassIntrospector()
Method Detail

processAccessTypeField

protected void processAccessTypeField(java.lang.Class<T> toInspect)
If the access type is field, we will extract all the necessary meta informations form the fields

Parameters:
toInspect - - the class to inspect

processAccessTypeProperty

protected void processAccessTypeProperty(java.lang.Class<T> toInspect)
If the access type is property, we will extract all the necessary meta informations form the getter methods

Parameters:
toInspect - - the class to inspect

getPresistentFieldInfo

public PersistentPropertyInfo getPresistentFieldInfo(Property toCheck)
This method returns informations about a persistent field.

Specified by:
getPresistentFieldInfo in interface Introspector<T>
Parameters:
toCheck - the property for persistent db field
Returns:
persistent property info
See Also:
Introspector.getPresistentFieldInfo(Property)

getPrimaryKeyInfo

public PrimaryKeyInfo getPrimaryKeyInfo(Property toCheck)
This method returns informations about a persistent field.

Specified by:
getPrimaryKeyInfo in interface Introspector<T>
Parameters:
toCheck - the property for primary key
Returns:
pk info
See Also:
Introspector.getPrimaryKeyInfo(Property)

getPersitentProperties

public java.util.List<Property> getPersitentProperties()
Returns the persistent fields.

Specified by:
getPersitentProperties in interface Introspector<T>
Returns:
the list of persistent fields
See Also:
Introspector.getPersitentProperties()

getPkFields

public java.util.Set<Property> getPkFields()
Return the primary key fields.

Specified by:
getPkFields in interface Introspector<T>
Returns:
the list of primary key fields
See Also:
Introspector.getPkFields()

getTransientFields

public java.util.List<Property> getTransientFields()
Returns the transientFields.

Returns:
Returns the transientFields.

getField

public java.lang.Object getField(T instance,
                                 Property toGet)
                          throws java.lang.IllegalAccessException
Returns a value of an field.

Specified by:
getField in interface Introspector<T>
Parameters:
instance - - the instance (Typed)
toGet - - the parameter to get
Returns:
- the value of the parameter of the instance
Throws:
java.lang.IllegalAccessException - - in error case
Since:
15.10.2005

setField

public void setField(T instance,
                     Property toSet,
                     java.lang.Object value)
              throws java.lang.IllegalAccessException
Sets a value of the field.

Specified by:
setField in interface Introspector<T>
Parameters:
instance - - the instance (Typed)
toSet - - the parameter to set
value - - the new value
Throws:
java.lang.IllegalAccessException - - in error case
Since:
15.10.2005

getRepresentingClass

public java.lang.Class<T> getRepresentingClass()
Returns the representingClass.

Returns:
Returns the representingClass.

extractGenerator

protected void extractGenerator(java.lang.annotation.Annotation[] propertyAnnotations,
                                PrimaryKeyInfo info)

getLogger

protected abstract org.apache.log4j.Logger getLogger()
Returns the logger for this class.

Returns:


Copyright © 2008. All Rights Reserved.