Class GetEffectivePogoFieldSite
java.lang.Object
org.codehaus.groovy.runtime.callsite.AbstractCallSite
org.codehaus.groovy.runtime.callsite.GetEffectivePogoFieldSite
- All Implemented Interfaces:
CallSite
Call site that reads a field through a cached
CachedField while the
receiver is a GroovyObject whose meta class is the one captured
here and no category is active on the current thread.-
Field Summary
Fields inherited from class org.codehaus.groovy.runtime.callsite.AbstractCallSite
array, index, name -
Constructor Summary
ConstructorsConstructorDescriptionGetEffectivePogoFieldSite(CallSite site, MetaClass metaClass, CachedField effective) Copies the parent site and remembers the meta class and field to read. -
Method Summary
Modifier and TypeMethodDescriptionfinal CallSiteacceptGetProperty(Object receiver) Returns a newly created get-property site whenreceiveris not aGroovyObjectwithmetaClass, or a category is active.final CallSiteacceptGroovyObjectGetProperty(Object receiver) Returns a newly created Groovy-object get-property site whenreceiveris not aGroovyObjectwithmetaClass, or a category is active.final ObjectcallGetProperty(Object receiver) Reads the cached field whenreceiverstill matches this site.final ObjectcallGroovyObjectGetProperty(Object receiver) Reads the cached field whenreceiverstill matches this site.final ObjectgetProperty(Object receiver) Reads the field through the cachedCachedField.Methods inherited from class org.codehaus.groovy.runtime.callsite.AbstractCallSite
call, call, call, call, call, call, callConstructor, callConstructor, callConstructor, callConstructor, callConstructor, callConstructor, callCurrent, callCurrent, callCurrent, callCurrent, callCurrent, callCurrent, callGetPropertySafe, callGroovyObjectGetPropertySafe, callSafe, callSafe, callSafe, callSafe, callSafe, callSafe, callStatic, callStatic, callStatic, callStatic, callStatic, callStatic, createGetPropertySite, createGroovyObjectGetPropertySite, getArray, getIndex, getName
-
Constructor Details
-
GetEffectivePogoFieldSite
Copies the parent site and remembers the meta class and field to read.- Parameters:
site- the site whose name and index are copiedmetaClass- the meta class this site was built fromeffective- the field read when the receiver still matches
-
-
Method Details
-
acceptGetProperty
Returns a newly created get-property site whenreceiveris not aGroovyObjectwithmetaClass, or a category is active. Otherwise returns this site.- Overrides:
acceptGetPropertyin classAbstractCallSite
-
acceptGroovyObjectGetProperty
Returns a newly created Groovy-object get-property site whenreceiveris not aGroovyObjectwithmetaClass, or a category is active. Otherwise returns this site.- Overrides:
acceptGroovyObjectGetPropertyin classAbstractCallSite
-
callGetProperty
Reads the cached field whenreceiverstill matches this site. Otherwise creates a get-property site and reads through that.- Specified by:
callGetPropertyin interfaceCallSite- Overrides:
callGetPropertyin classAbstractCallSite- Parameters:
receiver- the object whose property is read- Returns:
- the property value
- Throws:
Throwable- when the read fails
-
callGroovyObjectGetProperty
Reads the cached field whenreceiverstill matches this site. Otherwise creates a Groovy-object get-property site and reads through that.- Specified by:
callGroovyObjectGetPropertyin interfaceCallSite- Overrides:
callGroovyObjectGetPropertyin classAbstractCallSite- Parameters:
receiver- the Groovy object whose property is read- Returns:
- the property value
- Throws:
Throwable- when the read fails
-
getProperty
Reads the field through the cachedCachedField.- Specified by:
getPropertyin interfaceCallSite- Overrides:
getPropertyin classAbstractCallSite- Parameters:
receiver- the object whose property is read- Returns:
- the property value
-