groovy.lang
Class MetaProperty

java.lang.Object
  extended bygroovy.lang.MetaProperty

public class MetaProperty
extends Object

Represents a property on a bean which may have a getter and/or a setter

Version:
$Revision: 1.1 $
Author:
James Strachan

Constructor Summary
MetaProperty(String name, Class type, MetaMethod getter, MetaMethod setter)
           
 
Method Summary
 MetaMethod getGetter()
           
 String getName()
           
 Object getProperty(Object object)
           
 MetaMethod getSetter()
           
 Class getType()
           
 void setProperty(Object object, Object newValue)
          Sets the property on the given object to the new value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaProperty

public MetaProperty(String name,
                    Class type,
                    MetaMethod getter,
                    MetaMethod setter)
Method Detail

getProperty

public Object getProperty(Object object)
                   throws Exception
Returns:
the property of the given object
Throws:
Exception - if the property could not be evaluated

setProperty

public void setProperty(Object object,
                        Object newValue)
                 throws Exception
Sets the property on the given object to the new value

Parameters:
object - on which to set the property
newValue - the new value of the property
Throws:
Exception - if the property could not be set

getGetter

public MetaMethod getGetter()

getName

public String getName()

getSetter

public MetaMethod getSetter()

getType

public Class getType()
Returns:
the type of the property


Copyright © 2003-2004 The Codehaus. All Rights Reserved.