|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.beans.BeanPropertyMapper
public class BeanPropertyMapper
Implementation of DynamicPropertyMapper that works off of a bean's regular compile-time properties as discovered by introspection. Is used to cache a set of property descriptors for non-dynamic beans for efficient retrieval, but can also be useful in the implementation of DynamicPropertyMappers that expose a combination of dynamic and compile-time properties.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
|
Constructor Summary | |
---|---|
BeanPropertyMapper(java.lang.Class pClass)
|
Method Summary | |
---|---|
java.lang.annotation.Annotation |
getAnnotation(java.lang.Object pBean,
java.lang.String pPropertyName,
java.lang.Class pAnnotationClass)
Gets a particular type of annotation, if it exists, for a property on a bean. |
java.util.Set<java.lang.annotation.Annotation> |
getAnnotations(java.lang.Object pBean,
java.lang.String pPropertyName)
Gets all of the annotations for a property on a bean. |
DynamicBeanInfo |
getBeanInfo(java.lang.Object pBean)
Gets a DynamicBeanInfo that describes the given dynamic bean. |
java.util.Set<java.lang.String> |
getPropertiesWithAnnotation(java.lang.Object pBean,
java.lang.Class pAnnotationClass)
Gets a set of property names that have a particular annotation. |
protected java.beans.PropertyDescriptor |
getPropertyDescriptor(java.lang.String pPropertyName)
Get a PropertyDescriptor for some property, in a case-insensitive matter. |
java.lang.Object |
getPropertyValue(java.lang.Object pBean,
java.lang.String pPropertyName)
Gets the value of the dynamic property from the specified object. |
java.lang.String |
getPropertyWithAnnotation(java.lang.Object pBean,
java.lang.Class pAnnotationClass)
Gets a property name for a property on a bean that has a particular annotation. |
static java.lang.reflect.Method |
getPublicMethod(java.lang.reflect.Method pMethod)
Returns a publicly-accessible version of the given method, by searching for a public declaring class. |
protected boolean |
isBeanProperty(java.lang.String pPropertyName)
Use this method in a subclass to determine whether or not the specified property name is a regular bean property (i.e. |
void |
setPropertyValue(java.lang.Object pBean,
java.lang.String pPropertyName,
java.lang.Object pValue)
Sets the value of the dynamic property from the specified object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public BeanPropertyMapper(java.lang.Class pClass)
Method Detail |
---|
protected boolean isBeanProperty(java.lang.String pPropertyName)
protected java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String pPropertyName)
pPropertyName
- the name of the property
public java.lang.Object getPropertyValue(java.lang.Object pBean, java.lang.String pPropertyName) throws PropertyNotFoundException
getPropertyValue
in interface DynamicPropertyMapper
PropertyNotFoundException
public void setPropertyValue(java.lang.Object pBean, java.lang.String pPropertyName, java.lang.Object pValue) throws PropertyNotFoundException
setPropertyValue
in interface DynamicPropertyMapper
PropertyNotFoundException
public DynamicBeanInfo getBeanInfo(java.lang.Object pBean) throws java.beans.IntrospectionException
getBeanInfo
in interface DynamicPropertyMapper
java.beans.IntrospectionException
- if no information is available.public static java.lang.reflect.Method getPublicMethod(java.lang.reflect.Method pMethod)
public java.util.Set<java.lang.annotation.Annotation> getAnnotations(java.lang.Object pBean, java.lang.String pPropertyName) throws java.beans.IntrospectionException
getAnnotations
in interface atg.beans.AnnotationDynamicPropertyMapper
pBean
- The objectpPropertyName
- The property name
java.beans.IntrospectionException
- Thrown if there is a problem retrieving the
annotations from the classpublic java.lang.annotation.Annotation getAnnotation(java.lang.Object pBean, java.lang.String pPropertyName, java.lang.Class pAnnotationClass) throws java.beans.IntrospectionException
getAnnotation
in interface atg.beans.AnnotationDynamicPropertyMapper
pBean
- The objectpPropertyName
- The property namepAnnotationClass
- The type of annotation
java.beans.IntrospectionException
- Thrown if there is a problem retrieving the
annotation from the classpublic java.lang.String getPropertyWithAnnotation(java.lang.Object pBean, java.lang.Class pAnnotationClass) throws java.beans.IntrospectionException
getPropertyWithAnnotation
in interface atg.beans.AnnotationDynamicPropertyMapper
pBean
- The objectpAnnotationClass
- The type of annotation
java.beans.IntrospectionException
- Thrown if there is a problem retrieving the
annotation from the classpublic java.util.Set<java.lang.String> getPropertiesWithAnnotation(java.lang.Object pBean, java.lang.Class pAnnotationClass) throws java.beans.IntrospectionException
getPropertiesWithAnnotation
in interface atg.beans.AnnotationDynamicPropertyMapper
pBean
- The objectpAnnotationClass
- The type of annotation
java.beans.IntrospectionException
- Thrown if there is a problem retrieving the
annotation from the class
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |