" should have constructor with single List<DataProvider> argument", e);
}
try {
provider = (T) constructor.newInstance(nestedDataProvs);
} catch (Exception e) {
throw new AdapterException(e);
}
} else if (DataFilter.class.isAssignableFrom(cls)) {
// DataFilter needs to be constructed with nested DataProvider as constructor arg
DataControlProviderDefinition<DataProvider> nestedDataProvDef =
providerDef.getNestedProviderDefinitions().get(0);
Class<DataProvider> dfltDataProvImpl =
(Class<DataProvider>) XMLDCConstants.DFLT_PROVIDERS.get(DataProvider.class);
DataProvider nestedDataProv = newProviderInstance(nestedDataProvDef, DataProvider.class, dfltDataProvImpl);
// now instantiate DataFilter with nested DataProvider
Constructor<DataFilter> constructor;
try {
constructor = ((Class<DataFilter>) cls).getConstructor(DataProvider.class);
} catch (NoSuchMethodException e) {
throw new IllegalStateException(cls.getName() +
" should have constructor with single DataProvider argument", e);
}
try {
provider = (T) constructor.newInstance(nestedDataProv);
} catch (Exception e) {
throw new AdapterException(e);
}
} else {
provider = Utils.newInstance(cls);
}
// supply all parameters to the instantiated class