groovy.lang
Class ExpandoMetaClass.ExpandoMetaProperty
java.lang.Object
groovy.lang.GroovyObjectSupport
groovy.lang.ExpandoMetaClass.ExpandoMetaProperty
- All Implemented Interfaces:
- GroovyObject
- Enclosing class:
- ExpandoMetaClass
protected class ExpandoMetaClass.ExpandoMetaProperty
- extends GroovyObjectSupport
Instances of this class are returned when using the << left shift operator.
Example:
metaClass.myMethod << { String args -> }
This allows callbacks to the ExpandoMetaClass for registering appending methods
- Author:
- Graeme Rocher
Method Summary |
private java.lang.reflect.Method |
checkIfMethodExists(java.lang.Class methodClass,
java.lang.String methodName,
java.lang.Class[] paramTypes,
boolean staticMethod)
|
java.lang.Object |
getProperty(java.lang.String property)
Retrieves a property value. |
java.lang.String |
getPropertyName()
|
boolean |
isStatic()
|
java.lang.Object |
leftShift(java.lang.Object arg)
|
private void |
registerIfClosure(java.lang.Object arg,
boolean replace)
|
void |
setProperty(java.lang.String property,
java.lang.Object newValue)
Sets the given property to the new value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
propertyName
protected java.lang.String propertyName
isStatic
protected boolean isStatic
ExpandoMetaClass.ExpandoMetaProperty
protected ExpandoMetaClass.ExpandoMetaProperty(java.lang.String name)
ExpandoMetaClass.ExpandoMetaProperty
protected ExpandoMetaClass.ExpandoMetaProperty(java.lang.String name,
boolean isStatic)
getPropertyName
public java.lang.String getPropertyName()
isStatic
public boolean isStatic()
leftShift
public java.lang.Object leftShift(java.lang.Object arg)
registerIfClosure
private void registerIfClosure(java.lang.Object arg,
boolean replace)
checkIfMethodExists
private java.lang.reflect.Method checkIfMethodExists(java.lang.Class methodClass,
java.lang.String methodName,
java.lang.Class[] paramTypes,
boolean staticMethod)
getProperty
public java.lang.Object getProperty(java.lang.String property)
- Description copied from interface:
GroovyObject
- Retrieves a property value.
- Specified by:
getProperty
in interface GroovyObject
- Overrides:
getProperty
in class GroovyObjectSupport
- Parameters:
property
- the name of the property of interest
- Returns:
- the given property
setProperty
public void setProperty(java.lang.String property,
java.lang.Object newValue)
- Description copied from interface:
GroovyObject
- Sets the given property to the new value.
- Specified by:
setProperty
in interface GroovyObject
- Overrides:
setProperty
in class GroovyObjectSupport
- Parameters:
property
- the name of the property of interestnewValue
- the new value for the property
Copyright © ${year} The Codehaus. All Rights Reserved.