return null;
}
String fqn = metadataProviderType.getClassName();
Class<?> clazz = SecurityActions.loadClass(CoreConfigUtil.class, fqn);
IMetadataProvider metadataProvider;
try {
metadataProvider = (IMetadataProvider) clazz.newInstance();
} catch (Exception iae) {
throw new RuntimeException(iae);
}
List<KeyValueType> keyValues = metadataProviderType.getOption();
Map<String, String> options = new HashMap<String, String>();
if (keyValues != null) {
for (KeyValueType kvt : keyValues)
options.put(kvt.getKey(), kvt.getValue());
}
metadataProvider.init(options);
String fileInjectionStr = metadataProvider.requireFileInjection();
if (isNotNull(fileInjectionStr)) {
metadataProvider.injectFileStream(servletContext.getResourceAsStream(fileInjectionStr));
}
List<EntityDescriptorType> resultList = new ArrayList<EntityDescriptorType>();
if (metadataProvider.isMultiple()) {
EntitiesDescriptorType metadatas = (EntitiesDescriptorType) metadataProvider.getMetaData();
addAllEntityDescriptorsRecursively(resultList, metadatas);
} else {
EntityDescriptorType metadata = (EntityDescriptorType) metadataProvider.getMetaData();
resultList.add(metadata);
}
return resultList;
}