use of eu.esdihumboldt.util.groovy.meta.extension.MetaClassDescriptor in project hale by halestudio.
the class CustomMetaClassCreationHandle method createNormalMetaClass.
@Override
protected MetaClass createNormalMetaClass(@SuppressWarnings("rawtypes") Class theClass, MetaClassRegistry registry) {
MetaClass metaClass = super.createNormalMetaClass(theClass, registry);
for (MetaClassDescriptor descriptor : ext.getElements()) {
if (descriptorApplies(descriptor, theClass)) {
// create meta class
Class<?> delegatingMetaClass = descriptor.getMetaClass();
try {
Constructor<?> constructor = delegatingMetaClass.getConstructor(MetaClass.class);
metaClass = (MetaClass) constructor.newInstance(metaClass);
} catch (Exception e) {
e.printStackTrace();
}
}
}
return metaClass;
}
Aggregations