Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.6
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## groovy.lang
[Java] Class MetaProperty

    java.lang.Object
      groovy.lang.MetaProperty

    public abstract class MetaProperty
    extends Object

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

Authors:
  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)` @return the property of the given object
`static String` | `getSetterName(String propertyName)`
`Class` | `getType()` @return the type of the property
`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, equals, toString, hashCode, getClass, notify, notifyAll

Field Detail

### PROPERTY_SET_PREFIX

    public 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)

  throws:
    Exception if the property could not be evaluated
  Returns:
    the property of the given object

### getSetterName

    public static String getSetterName(String propertyName)

### getType

    public Class getType()

  Returns:
    the type of the property

### setProperty

    public void setProperty(Object object, Object newValue)

  Sets the property on the given object to the new value
  throws:
    RuntimeException if the property could not be set
  Parameters:
    `object` - on which to set the property
    `newValue` - the new value of the property

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