|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.groovy.grails.commons.metaclass.AbstractDynamicProperty
org.codehaus.groovy.grails.commons.metaclass.WeakGenericDynamicProperty
public class WeakGenericDynamicProperty
A generic dyanmic property for any type used a soft hashmap implementation for generic properties registered as global in the MetaClass
| Constructor Summary | |
|---|---|
WeakGenericDynamicProperty(String propertyName,
Class type,
boolean readOnly)
|
|
WeakGenericDynamicProperty(String propertyName,
Class type,
FunctionCallback initialValueGenerator,
boolean readOnly)
Variant that allows supply of a lazy-initialization function for the initial value. |
|
WeakGenericDynamicProperty(String propertyName,
Class type,
Object initialValue,
boolean readOnly)
|
|
| Method Summary | |
|---|---|
Object |
get(Object object)
Call the getter on the given object |
void |
set(Object object,
Object newValue)
Call the setter on the given object |
| Methods inherited from class org.codehaus.groovy.grails.commons.metaclass.AbstractDynamicProperty |
|---|
getPropertyName, isPropertyMatch |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WeakGenericDynamicProperty(String propertyName,
Class type,
Object initialValue,
boolean readOnly)
propertyName - The name of the propertytype - The type of the propertyinitialValue - The initial value of the propertyreadOnly - True for read-only property
public WeakGenericDynamicProperty(String propertyName,
Class type,
boolean readOnly)
propertyName - The name of the propertytype - The type of the propertyreadOnly - True for read-only property
public WeakGenericDynamicProperty(String propertyName,
Class type,
FunctionCallback initialValueGenerator,
boolean readOnly)
Variant that allows supply of a lazy-initialization function for the initial value.
This function is called only on the first access to the property for a given object, unless the function returns null in which case it will be called again if another request is made.
propertyName - The name of the propertytype - The type of the propertyreadOnly - True for read-only propertyinitialValueGenerator - Callback function which will be called for initial value of property| Method Detail |
|---|
public Object get(Object object)
DynamicProperty
get in interface DynamicPropertyget in class AbstractDynamicPropertyobject - The target object
public void set(Object object,
Object newValue)
DynamicProperty
set in interface DynamicPropertyset in class AbstractDynamicPropertyobject - The target objectnewValue - The new value of the property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||