org.codehaus.groovy.grails.commons.metaclass
Class AbstractDynamicProperty

java.lang.Object
  extended by org.codehaus.groovy.grails.commons.metaclass.AbstractDynamicProperty
All Implemented Interfaces:
DynamicProperty
Direct Known Subclasses:
AbstractDynamicControllerProperty, ConstraintsDynamicProperty, ConstraintsEvaluatingDynamicProperty, GenericDynamicProperty, WeakGenericDynamicProperty

public abstract class AbstractDynamicProperty
extends Object
implements DynamicProperty

An abstract class for implementors of dynamic getters to implement

Since:
Oct 24, 2005
Author:
Graeme Rocher

Constructor Summary
AbstractDynamicProperty(String propertyName)
           
 
Method Summary
abstract  Object get(Object object)
          Call the getter on the given object
 String getPropertyName()
           
 boolean isPropertyMatch(String propertyName)
          Whether the target class contains the specified property
abstract  void set(Object object, Object newValue)
          Call the setter on the given object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDynamicProperty

public AbstractDynamicProperty(String propertyName)
Method Detail

isPropertyMatch

public boolean isPropertyMatch(String propertyName)
Description copied from interface: DynamicProperty
Whether the target class contains the specified property

Specified by:
isPropertyMatch in interface DynamicProperty
Parameters:
propertyName - The name of the property
Returns:
True if the class has the property

getPropertyName

public String getPropertyName()
Specified by:
getPropertyName in interface DynamicProperty
Returns:
The name of the property

get

public abstract Object get(Object object)
Description copied from interface: DynamicProperty
Call the getter on the given object

Specified by:
get in interface DynamicProperty
Parameters:
object - The target object
Returns:
The result of the getter

set

public abstract void set(Object object,
                         Object newValue)
Description copied from interface: DynamicProperty
Call the setter on the given object

Specified by:
set in interface DynamicProperty
Parameters:
object - The target object
newValue - The new value of the property


Copyright (c) 2005-2009 The Grails project