import org.simantics.scl.compiler.types.Types;
import org.simantics.scl.reflection.TypeNotFoundException;
import org.simantics.scl.reflection.internal.registry.BindingRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class TypeRegistry {
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(TypeRegistry.class);
+
private static final ConcurrentHashMap<TCon, Class<?>> map =
new ConcurrentHashMap<TCon, Class<?>>();
map.put(Types.FLOAT, Float.class);
map.put(Types.DOUBLE, Double.class);
map.put(Types.STRING, String.class);
- map.put(Types.BYTE_ARRAY, byte[].class);
map.put(Types.LIST, List.class);
for(int i=0;i<8;++i)
map.put(Types.tupleConstructor(i),
Class.forName("org.simantics.scl.runtime.tuple.Tuple" + i));
} catch(ClassNotFoundException e) {
- e.printStackTrace();
+ LOGGER.error("Could not find class for {}", i, e);
}
for(TCon con : map.keySet())
try {
clazz = BindingRegistry.getClass(type);
} catch(TypeNotFoundException e) {
- e.printStackTrace();
+ LOGGER.error("Could not get class for type {}", type, e);
throw e;
}
map.put(type, clazz);