org.jboss.beans.info.plugins
Class NestedPropertyInfo

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.beans.info.plugins.NestedPropertyInfo
All Implemented Interfaces:
Serializable, Cloneable, PropertyInfo, AnnotatedInfo, org.jboss.util.JBossInterface

public class NestedPropertyInfo
extends org.jboss.util.JBossObject
implements PropertyInfo, Serializable

When bean has more than one property with the same name we try to use this impl to look over all possible setters in order to set the value. But for most of other methods there is insufficent information to invoke the right method - e.g. just property name and parent bean.

Author:
Ales Justin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Constructor Summary
NestedPropertyInfo(String name, BeanInfo beanInfo)
           
 
Method Summary
 boolean equals(Object object)
           
 Object get(Object bean)
          Get the property value
 AnnotationValue getAnnotation(String name)
          Get an annotation
 AnnotationValue[] getAnnotations()
          Get the annotations
 BeanInfo getBeanInfo()
          Get the BeanInfo
 FieldInfo getFieldInfo()
          Get the field info in case impl uses field to handle property ops.
 MethodInfo getGetter()
          Get the getter
 int getHashCode()
           
 String getName()
          Get the property name
 MethodInfo getSetter()
          Get the setter
 TypeInfo getType()
          In this case it is better to return null then to throw an exception, since we might still have enough information to use this class to set the value.
<T extends Annotation>
T
getUnderlyingAnnotation(Class<T> annotationType)
          Get an underlying annotation
 Annotation[] getUnderlyingAnnotations()
          Get the underlying annotations
 String getUpperName()
          Get the uppercase version of the property name
 boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
          Test whether an annotation is present
 boolean isAnnotationPresent(String name)
          Test whether an annotation is present
 boolean isReadable()
          Is property readable.
 boolean isWritable()
          Is property writable.
 void set(Object bean, Object value)
          Set the property value
 void setGetter(MethodInfo getter)
          Set the getter
 void setSetter(MethodInfo setter)
          Set the setter
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
 void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, hashCode, list, notEqual, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.util.JBossInterface
clone, toShortString
 

Constructor Detail

NestedPropertyInfo

public NestedPropertyInfo(String name,
                          BeanInfo beanInfo)
Method Detail

getBeanInfo

public BeanInfo getBeanInfo()
Description copied from interface: PropertyInfo
Get the BeanInfo

Specified by:
getBeanInfo in interface PropertyInfo
Returns:
the bean info

getName

public String getName()
Description copied from interface: PropertyInfo
Get the property name

Specified by:
getName in interface PropertyInfo
Returns:
the name

getUpperName

public String getUpperName()
Description copied from interface: PropertyInfo
Get the uppercase version of the property name

Specified by:
getUpperName in interface PropertyInfo
Returns:
the name

getType

public TypeInfo getType()
In this case it is better to return null then to throw an exception, since we might still have enough information to use this class to set the value.

Specified by:
getType in interface PropertyInfo
Returns:
null

set

public void set(Object bean,
                Object value)
         throws Throwable
Description copied from interface: PropertyInfo
Set the property value

Specified by:
set in interface PropertyInfo
Parameters:
bean - the bean
value - the property value
Throws:
Throwable - for any error

equals

public boolean equals(Object object)
Overrides:
equals in class Object

toString

public void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class org.jboss.util.JBossObject

toShortString

public void toShortString(org.jboss.util.JBossStringBuilder buffer)
Specified by:
toShortString in interface org.jboss.util.JBossInterface
Overrides:
toShortString in class org.jboss.util.JBossObject

getHashCode

public int getHashCode()
Overrides:
getHashCode in class org.jboss.util.JBossObject

get

public Object get(Object bean)
           throws Throwable
Description copied from interface: PropertyInfo
Get the property value

Specified by:
get in interface PropertyInfo
Parameters:
bean - the bean
Returns:
the property value
Throws:
Throwable - for any error

getGetter

public MethodInfo getGetter()
Description copied from interface: PropertyInfo
Get the getter

Specified by:
getGetter in interface PropertyInfo
Returns:
the getter

setGetter

public void setGetter(MethodInfo getter)
Description copied from interface: PropertyInfo
Set the getter

Specified by:
setGetter in interface PropertyInfo
Parameters:
getter - the getter

getSetter

public MethodInfo getSetter()
Description copied from interface: PropertyInfo
Get the setter

Specified by:
getSetter in interface PropertyInfo
Returns:
the setter

setSetter

public void setSetter(MethodInfo setter)
Description copied from interface: PropertyInfo
Set the setter

Specified by:
setSetter in interface PropertyInfo
Parameters:
setter - the setter

isReadable

public boolean isReadable()
Description copied from interface: PropertyInfo
Is property readable.

Specified by:
isReadable in interface PropertyInfo
Returns:
true if the property is readable

isWritable

public boolean isWritable()
Description copied from interface: PropertyInfo
Is property writable.

Specified by:
isWritable in interface PropertyInfo
Returns:
true if the property is writable

getFieldInfo

public FieldInfo getFieldInfo()
Description copied from interface: PropertyInfo
Get the field info in case impl uses field to handle property ops.

Specified by:
getFieldInfo in interface PropertyInfo
Returns:
the field info or null if no such info available

getAnnotations

public AnnotationValue[] getAnnotations()
Description copied from interface: AnnotatedInfo
Get the annotations

Specified by:
getAnnotations in interface AnnotatedInfo
Returns:
the annotations

getAnnotation

public AnnotationValue getAnnotation(String name)
Description copied from interface: AnnotatedInfo
Get an annotation

Specified by:
getAnnotation in interface AnnotatedInfo
Parameters:
name - the name
Returns:
the annotation

isAnnotationPresent

public boolean isAnnotationPresent(String name)
Description copied from interface: AnnotatedInfo
Test whether an annotation is present

Specified by:
isAnnotationPresent in interface AnnotatedInfo
Parameters:
name - the name
Returns:
true when the annotation is present

getUnderlyingAnnotations

public Annotation[] getUnderlyingAnnotations()
Description copied from interface: AnnotatedInfo
Get the underlying annotations

Specified by:
getUnderlyingAnnotations in interface AnnotatedInfo
Returns:
the annotations

getUnderlyingAnnotation

public <T extends Annotation> T getUnderlyingAnnotation(Class<T> annotationType)
Description copied from interface: AnnotatedInfo
Get an underlying annotation

Specified by:
getUnderlyingAnnotation in interface AnnotatedInfo
Type Parameters:
T - the annotation type
Parameters:
annotationType - the annotationType
Returns:
the annotation

isAnnotationPresent

public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
Description copied from interface: AnnotatedInfo
Test whether an annotation is present

Specified by:
isAnnotationPresent in interface AnnotatedInfo
Returns:
true when the annotation is present


Copyright © 2010 JBoss, a division of Red Hat, Inc.. All Rights Reserved.