use of de.metas.process.ProcessClassInfo in project metasfresh-webui-api by metasfresh.
the class WebuiProcessClassInfo method createWebuiProcessClassInfo.
private static WebuiProcessClassInfo createWebuiProcessClassInfo(final Class<?> processClass) throws Exception {
final ProcessClassInfo processClassInfo = ProcessClassInfo.of(processClass);
final WebuiProcess webuiProcessAnn = processClass.getAnnotation(WebuiProcess.class);
@SuppressWarnings("unchecked") final Set<Method> lookupValuesProviderMethods = ReflectionUtils.getAllMethods(processClass, ReflectionUtils.withAnnotation(ProcessParamLookupValuesProvider.class));
final ImmutableMap<String, LookupDescriptorProvider> paramLookupValuesProviders = lookupValuesProviderMethods.stream().map(method -> createParamLookupValuesProvider(method)).collect(GuavaCollectors.toImmutableMap());
// Check is there were no settings at all so we could return our NULL instance
if (ProcessClassInfo.isNull(processClassInfo) && paramLookupValuesProviders.isEmpty()) {
return NULL;
}
return new WebuiProcessClassInfo(processClassInfo, webuiProcessAnn, paramLookupValuesProviders);
}
Aggregations