
com.podio.item.map.converter.FieldConverterRegistry Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api Show documentation
Show all versions of api Show documentation
The official Java wrapper for the Podio API
package com.podio.item.map.converter;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import com.podio.app.ApplicationField;
public class FieldConverterRegistry {
private static final List REGISTRY = new ArrayList();
static {
REGISTRY.add(new MoneyConverterProvider());
REGISTRY.add(new StateConverterProvider());
REGISTRY.add(new NumberConverterProvider());
REGISTRY.add(new TextConverterProvider());
REGISTRY.add(new ProgressConverterProvider());
}
private FieldConverterRegistry() {
}
public static FieldConverter getConverter(ApplicationField field,
Method readMethod) {
for (FieldConverterProvider provider : REGISTRY) {
if (provider.isSupported(field.getType())) {
return provider.getConverter(field, readMethod);
}
}
throw new RuntimeException("No converter found for field of type "
+ field.getType());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy