net.sf.beanlib.hibernate
Class HibernatePropertyFilter

java.lang.Object
  extended by net.sf.beanlib.hibernate.HibernatePropertyFilter
All Implemented Interfaces:
net.sf.beanlib.spi.PropertyFilter

public class HibernatePropertyFilter
extends java.lang.Object
implements net.sf.beanlib.spi.PropertyFilter

A default implementation used to determine if a Hibernate property that follows the JavaBean getter/setter convention should be propagated. Each propagation decision can be controlled by specifying

Author:
Joe D. Velopar

Constructor Summary
HibernatePropertyFilter()
          Constructs with the default behavior of replicating all properties recursively.
HibernatePropertyFilter(java.util.Set<java.lang.Class<?>> entityBeanClassSet, java.util.Set<? extends net.sf.beanlib.CollectionPropertyName<?>> collectionPropertyNameSet, net.sf.beanlib.spi.PropertyFilter vetoer)
          Constructs with the specified options of controlling what to be replicated and what not.
HibernatePropertyFilter(java.lang.String applicationPackagePrefix)
          Constructs with an application package prefix.
HibernatePropertyFilter(java.lang.String applicationPackagePrefix, java.util.Set<java.lang.Class<?>> entityBeanClassSet, java.util.Set<? extends net.sf.beanlib.CollectionPropertyName<?>> collectionPropertyNameSet, net.sf.beanlib.spi.PropertyFilter vetoer)
          Constructs with the specified options of controlling what to be replicated and what not.
 
Method Summary
 java.util.Set<net.sf.beanlib.CollectionPropertyName<?>> getCollectionPropertyNameSet()
          Returns the configured set of collection and map properties that are to be replicated, eagerly fetching if necessary; null if all collection and map properties are to be replicated; or empty if no collection nor map properties are to be replicated.
 java.util.Set<java.lang.Class<?>> getEntityBeanClassSet()
          Returns the configured set of entity bean classes for matching properties that will be replicated, eagerly fetching if necessary; null if all entity bean classes are to be replicated; or empty if no entity bean class is to be replicated.
 net.sf.beanlib.spi.PropertyFilter getVetoer()
          Returns the vetoer configured for vetoing the propagation of a property.
 boolean isApplicationClass(java.lang.Class<?> c)
          Returns true iff c is an application class.
 boolean propagate(java.lang.String propertyName, java.lang.reflect.Method readerMethod)
           
 boolean propagateImpl(java.lang.String propertyName, java.lang.reflect.Method readerMethod)
           
 HibernatePropertyFilter withCollectionPropertyNameSet(java.util.Set<? extends net.sf.beanlib.CollectionPropertyName<?>> collectionPropertyNameSet)
          Used to configure the set of collection and map properties that will be replicated, eagerly fetching if necessary.
 HibernatePropertyFilter withEntityBeanClassSet(java.util.Set<java.lang.Class<?>> entityBeanClassSet)
          Used to configure the set of entity bean classes for matching properties that will be replicated, eagerly fetching if necessary.
 HibernatePropertyFilter withVetoer(net.sf.beanlib.spi.PropertyFilter vetoer)
          Used to configure a vetoer for vetoing the propagation of a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernatePropertyFilter

public HibernatePropertyFilter(java.util.Set<java.lang.Class<?>> entityBeanClassSet,
                               java.util.Set<? extends net.sf.beanlib.CollectionPropertyName<?>> collectionPropertyNameSet,
                               net.sf.beanlib.spi.PropertyFilter vetoer)
Constructs with the specified options of controlling what to be replicated and what not.

Parameters:
entityBeanClassSet - The set of entity bean classes for matching properties that will be replicated, eagerly fetching if necessary. Null means all whereas empty means none.
collectionPropertyNameSet - The set of collection and map properties that will be replicated, eagerly fetching if necessary. Null means all whereas empty means none.
vetoer - used to veto the propagation of a JavaBean property.

HibernatePropertyFilter

public HibernatePropertyFilter(java.lang.String applicationPackagePrefix,
                               java.util.Set<java.lang.Class<?>> entityBeanClassSet,
                               java.util.Set<? extends net.sf.beanlib.CollectionPropertyName<?>> collectionPropertyNameSet,
                               net.sf.beanlib.spi.PropertyFilter vetoer)
Constructs with the specified options of controlling what to be replicated and what not.

Parameters:
applicationPackagePrefix - An entity bean under a package with a name that matches this prefix will be included for replication, eagerly fetched if necessary. Otherwise, the semantics of entityBeanClassSet applies.
entityBeanClassSet - The set of entity bean classes for matching properties that will be replicated, eagerly fetching if necessary. Null means all whereas empty means none.
collectionPropertyNameSet - The set of collection and map properties that will be replicated, eagerly fetching if necessary. Null means all whereas empty means none.
vetoer - used to veto the propagation of a JavaBean property.

HibernatePropertyFilter

public HibernatePropertyFilter()
Constructs with the default behavior of replicating all properties recursively.


HibernatePropertyFilter

public HibernatePropertyFilter(java.lang.String applicationPackagePrefix)
Constructs with an application package prefix.

Parameters:
applicationPackagePrefix - An entity bean under a package with a name that matches this prefix will be included for replication, eagerly fetched if necessary. Otherwise, the semantics of entityBeanClassSet applies.
Method Detail

getEntityBeanClassSet

public java.util.Set<java.lang.Class<?>> getEntityBeanClassSet()
Returns the configured set of entity bean classes for matching properties that will be replicated, eagerly fetching if necessary; null if all entity bean classes are to be replicated; or empty if no entity bean class is to be replicated.


withEntityBeanClassSet

public HibernatePropertyFilter withEntityBeanClassSet(java.util.Set<java.lang.Class<?>> entityBeanClassSet)
Used to configure the set of entity bean classes for matching properties that will be replicated, eagerly fetching if necessary.

Parameters:
entityBeanClassSet - the set of entity bean classes for matching properties that will be replicated, eagerly fetching if necessary. null if all entity bean classes are to be replicated; or empty if no entity bean class is to be replicated.
Returns:
the current instance for method chaining purposes.

getCollectionPropertyNameSet

public java.util.Set<net.sf.beanlib.CollectionPropertyName<?>> getCollectionPropertyNameSet()
Returns the configured set of collection and map properties that are to be replicated, eagerly fetching if necessary; null if all collection and map properties are to be replicated; or empty if no collection nor map properties are to be replicated.


withCollectionPropertyNameSet

public HibernatePropertyFilter withCollectionPropertyNameSet(java.util.Set<? extends net.sf.beanlib.CollectionPropertyName<?>> collectionPropertyNameSet)
Used to configure the set of collection and map properties that will be replicated, eagerly fetching if necessary.

Parameters:
collectionPropertyNameSet - set of collection and map properties that will be replicated, eagerly fetching if necessary; null if all collection and map properties are to be replicated; or empty if no collection nor map properties are to be replicated.
Returns:
the current instance for method chaining purposes.

getVetoer

public net.sf.beanlib.spi.PropertyFilter getVetoer()
Returns the vetoer configured for vetoing the propagation of a property.


withVetoer

public HibernatePropertyFilter withVetoer(net.sf.beanlib.spi.PropertyFilter vetoer)
Used to configure a vetoer for vetoing the propagation of a property.

Returns:
the current instance for method chaining purposes.

propagate

public boolean propagate(java.lang.String propertyName,
                         java.lang.reflect.Method readerMethod)
Specified by:
propagate in interface net.sf.beanlib.spi.PropertyFilter

propagateImpl

public boolean propagateImpl(java.lang.String propertyName,
                             java.lang.reflect.Method readerMethod)

isApplicationClass

public boolean isApplicationClass(java.lang.Class<?> c)
Returns true iff c is an application class.



Copyright © 2009. All Rights Reserved.