org.jboss.seam.solder.properties
Interface Property<V>

Type Parameters:
V - the type of the properties value
All Known Subinterfaces:
FieldProperty<V>, MethodProperty<V>

public interface Property<V>

A representation of a JavaBean style property

Author:
Pete Muir, Shane Bryzak
See Also:
Properties

Method Summary
 AnnotatedElement getAnnotatedElement()
          Get the element responsible for retrieving the property value
 Type getBaseType()
          Returns the property type
 Class<?> getDeclaringClass()
          Returns the class that declares the property
 Class<V> getJavaClass()
          Returns the property type
 Member getMember()
          Get the member responsible for retrieving the property value
 String getName()
          Returns the name of the property.
 V getValue(Object instance)
          Returns the property value for the specified bean.
 boolean isReadOnly()
          Indicates whether this is a read-only property
 void setAccessible()
          Calls the setAccessible method on the underlying member(s).
 void setValue(Object instance, V value)
          This method sets the property value for a specified bean to the specified value.
 

Method Detail

getName

String getName()
Returns the name of the property. If the property is a field, then the field name is returned. Otherwise, if the property is a method, then the name that is returned is the getter method name without the "get" or "is" prefix, and a lower case first letter.

Returns:
The name of the property

getBaseType

Type getBaseType()
Returns the property type

Returns:
The property type

getJavaClass

Class<V> getJavaClass()
Returns the property type

Returns:
The property type

getAnnotatedElement

AnnotatedElement getAnnotatedElement()
Get the element responsible for retrieving the property value

Returns:

getMember

Member getMember()
Get the member responsible for retrieving the property value

Returns:

getValue

V getValue(Object instance)
Returns the property value for the specified bean. The property to be returned is either a field or getter method.

Parameters:
bean - The bean to read the property from
Returns:
The property value
Throws:
ClassCastException - if the value is not of the type V

setValue

void setValue(Object instance,
              V value)
This method sets the property value for a specified bean to the specified value. The property to be set is either a field or setter method.

Parameters:
bean - The bean containing the property to set
value - The new property value

getDeclaringClass

Class<?> getDeclaringClass()
Returns the class that declares the property

Returns:

isReadOnly

boolean isReadOnly()
Indicates whether this is a read-only property

Returns:

setAccessible

void setAccessible()
Calls the setAccessible method on the underlying member(s).

The operation should be performed within a PrivilegedAction



Copyright © 2011 Seam Framework. All Rights Reserved.