站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

MethodBoundPropertyListener (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util.property
Class MethodBoundPropertyListener

java.lang.Object
  extended byorg.jboss.util.property.PropertyAdapter
      extended byorg.jboss.util.property.BoundPropertyAdapter
          extended byorg.jboss.util.property.MethodBoundPropertyListener
All Implemented Interfaces:
BoundPropertyListener, EventListener, PropertyListener

public class MethodBoundPropertyListener
extends BoundPropertyAdapter

Binds property values to class methods.

Version:
$Revision: 1.3 $
Author:
Jason Dillon

Field Summary
protected  PropertyDescriptor descriptor
          Property descriptor
protected  Object instance
          Instance object that contains setter method
protected  String propertyName
          Property name which we are bound to
protected  Method setter
          Property setter method
 
Constructor Summary
MethodBoundPropertyListener(Object instance, String propertyName)
          Construct a MethodBoundPropertyListener.
MethodBoundPropertyListener(Object instance, String propertyName, String beanPropertyName)
          Construct a MethodBoundPropertyListener.
 
Method Summary
 String getPropertyName()
          Get the property name which this listener is bound to.
protected  void invokeSetter(String value)
          Coerce and invoke the property setter method on the instance.
 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 changed.
 
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 String propertyName
Property name which we are bound to


instance

protected final Object instance
Instance object that contains setter method


setter

protected final Method setter
Property setter method


descriptor

protected final PropertyDescriptor descriptor
Property descriptor

Constructor Detail

MethodBoundPropertyListener

public MethodBoundPropertyListener(Object instance,
                                   String propertyName,
                                   String beanPropertyName)
Construct a MethodBoundPropertyListener.

Parameters:
instance - Instance object that contains setter method.
propertyName - The name of the property which will be bound.
beanPropertyName - The name of the property setter method.
Throws:
PropertyException

MethodBoundPropertyListener

public MethodBoundPropertyListener(Object instance,
                                   String propertyName)
Construct a MethodBoundPropertyListener.

Parameters:
instance - Instance object that contains setter method.
propertyName - The name of the property which will be bound.
Method Detail

getPropertyName

public final String getPropertyName()
Get the property name which this listener is bound to.

Returns:
Property name.

invokeSetter

protected void invokeSetter(String value)
Coerce and invoke the property setter method on the instance.

Parameters:
value - Method value.
Throws:
PropertyException - Failed to invoke setter method.

propertyAdded

public void propertyAdded(PropertyEvent event)
Notifies that a property has been added.

Specified by:
propertyAdded in interface PropertyListener
Overrides:
propertyAdded in class PropertyAdapter
Parameters:
event - Property event.

propertyChanged

public void propertyChanged(PropertyEvent event)
Notifies that a property has changed.

Specified by:
propertyChanged in interface PropertyListener
Overrides:
propertyChanged in class PropertyAdapter
Parameters:
event - Property event.

propertyBound

public void propertyBound(PropertyMap map)
Notifies that this listener was bound to a property.

Specified by:
propertyBound in interface BoundPropertyListener
Overrides:
propertyBound in class BoundPropertyAdapter
Parameters:
map - PropertyMap which contains property bound to.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.