|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Handles the ability to use the left shift operator to append new constructors
Constructor Summary | |
ExpandoMetaConstructor()
|
Method Summary | |
---|---|
void |
checkIfGroovyObjectMethod(ClosureMetaMethod metaMethod, String methodName)
Checks if the metaMethod is a method from the GroovyObject interface such as setProperty, getProperty and invokeMethod |
String |
convertPropertyName(String prop)
|
List |
getExpandoMethods()
Returns a list of expando MetaMethod instances added to this ExpandoMetaClass |
Collection |
getExpandoProperties()
Returns a list of MetaBeanProperty instances added to this ExpandoMetaClass |
Class |
getJavaClass()
|
MetaClass |
getMetaClass()
|
MetaProperty |
getMetaProperty(String name)
Looks up an existing MetaProperty by name |
List |
getMethods()
Overrides the behaviour of parent getMethods() method to make MetaClass aware of added Expando methods |
List |
getProperties()
|
Object |
getProperty(String property)
|
Object |
getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass)
Overrides default implementation just in case getProperty method has been overriden by ExpandoMetaClass |
Object |
getProperty(Object object, String name)
Overrides default implementation just in case getProperty method has been overriden by ExpandoMetaClass |
String |
getPropertyForGetter(String getterName)
Returns a property name equivalent for the given getter name or null if it is not a getter |
String |
getPropertyForSetter(String setterName)
Returns a property name equivalent for the given setter name or null if it is not a getter |
boolean |
hasMetaMethod(String name, def args)
Checks whether a MetaMethod for the given name and arguments exists |
boolean |
hasMetaProperty(String name)
Returns true if the MetaClass has the given property |
boolean |
hasOverrideGetProperty(String name)
|
Object |
invokeMethod(String name, Object args)
|
Object |
invokeMethod(Class sender, Object object, String methodName, def originalArguments, boolean isCallToSuper, boolean fromInsideClass)
Overrides default implementation just in case invokeMethod has been overriden by ExpandoMetaClass |
Object |
invokeStaticMethod(Object object, String methodName, def arguments)
Overrides default implementation just in case a static invoke method has been set on ExpandoMetaClass |
boolean |
isGetPropertyMethod(String methodName)
|
boolean |
isGetter(String name, def args)
Returns true if the name of the method specified and the number of arguments make it a javabean property |
boolean |
isInvokeMethod(String methodName, ClosureMetaMethod metaMethod)
|
boolean |
isSetPropertyMethod(String methodName, ClosureMetaMethod metaMethod)
|
boolean |
isSetter(String name, def args)
|
boolean |
isValidExpandoProperty(String property)
|
Object |
leftShift(Closure c)
|
void |
performOperationOnMetaClass(Callable c)
|
void |
performRegistryCallbacks()
|
void |
refreshInheritedMethods(Set modifiedSuperExpandos)
Called from ExpandoMetaClassCreationHandle in the registry if it exists to setup inheritance handling |
void |
registerBeanProperty(String property, Object newValue)
Registers a new bean property |
void |
registerBeanPropertyForMethod(MetaMethod metaMethod, String propertyName, boolean getter, boolean isStatic)
|
void |
registerInstanceMethod(String methodName, Closure callable)
Registers a new instance method for the given method name and closure on this MetaClass |
void |
registerStaticMethod(String name, Closure callable)
Registers a new static method for the given method name and closure on this MetaClass |
void |
setMetaClass(MetaClass metaClass)
|
void |
setProperty(String property, Object newValue)
|
void |
setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass)
Overrides default implementation just in case setProperty method has been overriden by ExpandoMetaClass |
Constructor Detail |
---|
ExpandoMetaConstructor()
Method Detail |
---|
void checkIfGroovyObjectMethod(ClosureMetaMethod metaMethod, String methodName)
String convertPropertyName(String prop)
public List getExpandoMethods()
public Collection getExpandoProperties()
public Class getJavaClass()
public MetaClass getMetaClass()
public MetaProperty getMetaProperty(String name)
public List getMethods()
public List getProperties()
public Object getProperty(String property)
public Object getProperty(Class sender, Object object, String name, boolean useSuper, boolean fromInsideClass)
public Object getProperty(Object object, String name)
String getPropertyForGetter(String getterName)
public String getPropertyForSetter(String setterName)
public boolean hasMetaMethod(String name, def args)
public boolean hasMetaProperty(String name)
boolean hasOverrideGetProperty(String name)
public Object invokeMethod(String name, Object args)
public Object invokeMethod(Class sender, Object object, String methodName, def originalArguments, boolean isCallToSuper, boolean fromInsideClass)
public Object invokeStaticMethod(Object object, String methodName, def arguments)
boolean isGetPropertyMethod(String methodName)
boolean isGetter(String name, def args)
boolean isInvokeMethod(String methodName, ClosureMetaMethod metaMethod)
boolean isSetPropertyMethod(String methodName, ClosureMetaMethod metaMethod)
public boolean isSetter(String name, def args)
boolean isValidExpandoProperty(String property)
public Object leftShift(Closure c)
void performOperationOnMetaClass(Callable c)
void performRegistryCallbacks()
public void refreshInheritedMethods(Set modifiedSuperExpandos)
void registerBeanProperty(String property, Object newValue)
void registerBeanPropertyForMethod(MetaMethod metaMethod, String propertyName, boolean getter, boolean isStatic)
void registerInstanceMethod(String methodName, Closure callable)
void registerStaticMethod(String name, Closure callable)
public void setMetaClass(MetaClass metaClass)
public void setProperty(String property, Object newValue)
public void setProperty(Class sender, Object object, String name, Object newValue, boolean useSuper, boolean fromInsideClass)