groovy.lang
Class MetaProperty
java.lang.Object
groovy.lang.MetaProperty
- Direct Known Subclasses:
- MetaArrayLengthProperty, MetaBeanProperty, MetaExpandoProperty, MetaFieldProperty
- public abstract class MetaProperty
- extends java.lang.Object
Represents a property on a bean which may have a getter and/or a setter
- Version:
- $Revision: 1.2 $
- Author:
- James Strachan
Field Summary |
protected java.lang.String |
name
|
protected java.lang.Class |
type
|
Constructor Summary |
MetaProperty(java.lang.String name,
java.lang.Class type)
|
Method Summary |
java.lang.String |
getName()
|
abstract java.lang.Object |
getProperty(java.lang.Object object)
|
java.lang.Class |
getType()
|
abstract void |
setProperty(java.lang.Object object,
java.lang.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 |
name
protected java.lang.String name
type
protected java.lang.Class type
MetaProperty
public MetaProperty(java.lang.String name,
java.lang.Class type)
getProperty
public abstract java.lang.Object getProperty(java.lang.Object object)
throws java.lang.Exception
- Returns:
- the property of the given object
- Throws:
java.lang.Exception
- if the property could not be evaluated
setProperty
public abstract void setProperty(java.lang.Object object,
java.lang.Object newValue)
- Sets the property on the given object to the new value
- Parameters:
object
- on which to set the propertynewValue
- the new value of the property
- Throws:
java.lang.Exception
- if the property could not be set
getName
public java.lang.String getName()
getType
public java.lang.Class getType()
- Returns:
- the type of the property
Copyright © 2003-2005 The Codehaus. All Rights Reserved.