MCPcopy Index your code
hub / github.com/apache/groovy / addProperties

Method addProperties

src/main/java/groovy/lang/MetaClassImpl.java:3677–3712  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3675 }
3676
3677 private void addProperties() {
3678 BeanInfo info;
3679 try {
3680 if (isBeanDerivative(theClass)) {
3681 info = Introspector.getBeanInfo(theClass, Introspector.IGNORE_ALL_BEANINFO);
3682 } else {
3683 info = Introspector.getBeanInfo(theClass);
3684 }
3685 } catch (Exception e) {
3686 throw new GroovyRuntimeException("exception during bean introspection", e);
3687 }
3688 PropertyDescriptor[] descriptors = info.getPropertyDescriptors();
3689 // build up the metaproperties based on the public fields, property descriptors,
3690 // and the getters and setters
3691 setUpProperties(descriptors);
3692 addRecordProperties(info);
3693
3694 EventSetDescriptor[] eventDescriptors = info.getEventSetDescriptors();
3695 for (EventSetDescriptor descriptor : eventDescriptors) {
3696 Method[] listenerMethods = descriptor.getListenerMethods();
3697 for (Method listenerMethod : listenerMethods) {
3698 final MetaMethod metaMethod = CachedMethod.find(descriptor.getAddListenerMethod());
3699 // GROOVY-5202
3700 // there might be a non-public listener of some kind
3701 // we skip that here
3702 if (metaMethod == null) continue;
3703 addToAllMethodsIfPublic(metaMethod);
3704 String name = listenerMethod.getName();
3705 if (listeners.containsKey(name)) {
3706 listeners.put(name, AMBIGUOUS_LISTENER_METHOD);
3707 } else {
3708 listeners.put(name, metaMethod);
3709 }
3710 }
3711 }
3712 }
3713
3714 private void addRecordProperties(BeanInfo info) {
3715 VMPlugin plugin = VMPluginFactory.getPlugin();

Callers 1

reinitializeMethod · 0.95

Calls 9

isBeanDerivativeMethod · 0.95
setUpPropertiesMethod · 0.95
addRecordPropertiesMethod · 0.95
findMethod · 0.95
getNameMethod · 0.65
containsKeyMethod · 0.65
putMethod · 0.65

Tested by

no test coverage detected