Package org.jboss.util.property
Class FieldBoundPropertyListener
- java.lang.Object
-
- org.jboss.util.property.PropertyAdapter
-
- org.jboss.util.property.BoundPropertyAdapter
-
- org.jboss.util.property.FieldBoundPropertyListener
-
- All Implemented Interfaces:
java.util.EventListener
,BoundPropertyListener
,PropertyListener
public class FieldBoundPropertyListener extends BoundPropertyAdapter
Binds property values to class fields.- Version:
- $Revision$
-
-
Field Summary
Fields Modifier and Type Field Description protected FieldInstance
fieldInstance
Field instanceprotected java.lang.String
propertyName
Property name which we are bound to
-
Constructor Summary
Constructors Constructor Description FieldBoundPropertyListener(java.lang.Object instance, java.lang.String fieldName)
Constructs a FieldBoundPropertyListener.FieldBoundPropertyListener(java.lang.Object instance, java.lang.String fieldName, java.lang.String propertyName)
Constructs a FieldBoundPropertyListener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
filterValue(java.lang.String value)
Filter the property value prior to coercing and binding to field.java.lang.String
getPropertyName()
Get the property name which this listener is bound to.void
propertyAdded(PropertyEvent event)
Notifies that a property has been added.void
propertyBound(PropertyMap map)
Notifies that this listener was bound to a property.void
propertyChanged(PropertyEvent event)
Notifies that a property has changedprotected void
setFieldValue(java.lang.String value)
Coerce and set specified value to field.-
Methods inherited from class org.jboss.util.property.BoundPropertyAdapter
propertyUnbound
-
Methods inherited from class org.jboss.util.property.PropertyAdapter
propertyRemoved
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.util.property.PropertyListener
propertyRemoved
-
-
-
-
Field Detail
-
propertyName
protected final java.lang.String propertyName
Property name which we are bound to
-
fieldInstance
protected final FieldInstance fieldInstance
Field instance
-
-
Constructor Detail
-
FieldBoundPropertyListener
public FieldBoundPropertyListener(java.lang.Object instance, java.lang.String fieldName, java.lang.String propertyName)
Constructs a FieldBoundPropertyListener.- Parameters:
instance
- Instance object.fieldName
- Field name.propertyName
- Property to bind to.- Throws:
NullArgumentException
- Property name is null.
-
FieldBoundPropertyListener
public FieldBoundPropertyListener(java.lang.Object instance, java.lang.String fieldName)
Constructs a FieldBoundPropertyListener.Field name is used for property name.
- Parameters:
instance
- Instance object.fieldName
- Field name.
-
-
Method Detail
-
getPropertyName
public final java.lang.String getPropertyName()
Get the property name which this listener is bound to.- Returns:
- Property name.
-
filterValue
public java.lang.String filterValue(java.lang.String value)
Filter the property value prior to coercing and binding to field.Allows instance to filter values prior to object coercion and field binding.
- Parameters:
value
- Property value.- Returns:
- the filtered value
-
setFieldValue
protected void setFieldValue(java.lang.String value)
Coerce and set specified value to field.- Parameters:
value
- Field value.- Throws:
PropertyException
- Failed to set field value.
-
propertyAdded
public void propertyAdded(PropertyEvent event)
Notifies that a property has been added.- Specified by:
propertyAdded
in interfacePropertyListener
- Overrides:
propertyAdded
in classPropertyAdapter
- Parameters:
event
- Property event.
-
propertyChanged
public void propertyChanged(PropertyEvent event)
Notifies that a property has changed- Specified by:
propertyChanged
in interfacePropertyListener
- Overrides:
propertyChanged
in classPropertyAdapter
- Parameters:
event
- Property event
-
propertyBound
public void propertyBound(PropertyMap map)
Notifies that this listener was bound to a property.- Specified by:
propertyBound
in interfaceBoundPropertyListener
- Overrides:
propertyBound
in classBoundPropertyAdapter
- Parameters:
map
- PropertyMap which contains property bound to.
-
-