Groovy 1.7.0

groovy.lang
Class MetaProperty

java.lang.Object
  groovy.lang.MetaProperty

class MetaProperty
extends Object

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

author:
James Strachan
version:
$Revision: 14463 $


Field Summary
static String PROPERTY_SET_PREFIX

protected String name

protected Class type

 
Constructor Summary
MetaProperty(String name, Class type)

 
Method Summary
static String getGetterName(String propertyName, Class type)

int getModifiers()

String getName()

Object getProperty(Object object)

static String getSetterName(String propertyName)

Class getType()

void setProperty(Object object, Object newValue)

Sets the property on the given object to the new value

 
Methods inherited from class Object
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll
 

Field Detail

PROPERTY_SET_PREFIX

static final String PROPERTY_SET_PREFIX


name

protected final String name


type

protected Class type


 
Constructor Detail

MetaProperty

public MetaProperty(String name, Class type)


 
Method Detail

getGetterName

public static String getGetterName(String propertyName, Class type)


getModifiers

public int getModifiers()


getName

public String getName()


getProperty

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


getSetterName

public static String getSetterName(String propertyName)


getType

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


setProperty

public void setProperty(Object object, Object newValue)
Sets the property on the given object to the new value
param:
object on which to set the property
param:
newValue the new value of the property
throws:
RuntimeException if the property could not be set


 

Copyright © 2003-2009 The Codehaus. All rights reserved.