MCPcopy
hub / github.com/apache/groovy / getMetaProperty

Method getMetaProperty

src/main/java/groovy/lang/MetaClassImpl.java:332–364  ·  view source on GitHub ↗

@see MetaObjectProtocol#getMetaProperty(String)

(final String name)

Source from the content-addressed store, hash-verified

330 * @see MetaObjectProtocol#getMetaProperty(String)
331 */
332 @Override
333 public MetaProperty getMetaProperty(final String name) {
334 MetaProperty metaProperty;
335
336 var propertyMap = classPropertyIndex.get(theCachedClass);
337 if (propertyMap != null) {
338 metaProperty = propertyMap.get(name);
339 if (metaProperty != null) {
340 return metaProperty;
341 }
342 }
343
344 metaProperty = staticPropertyIndex.get(name);
345 if (metaProperty != null) {
346 return metaProperty;
347 }
348
349 propertyMap = classPropertyIndexForSuper.get(theCachedClass);
350 if (propertyMap != null) {
351 metaProperty = propertyMap.get(name);
352 if (metaProperty != null) {
353 return metaProperty;
354 }
355 }
356
357 var metaBeanProperty = findPropertyInClassHierarchy(name, theCachedClass);
358 if (metaBeanProperty != null) {
359 metaProperty = metaBeanProperty;
360 onSuperPropertyFoundInHierarchy(metaBeanProperty);
361 }
362
363 return metaProperty;
364 }
365
366 /**
367 * @see MetaObjectProtocol#getStaticMetaMethod(String, Object[])

Callers 5

hasPropertyMethod · 0.95
setPropertyMethod · 0.95
getAttributeMethod · 0.95
setAttributeMethod · 0.95

Calls 4

getCachedClassMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected