import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.types.Types;
import org.simantics.scl.compiler.types.kinds.Kinds;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class SCLTypeUtils {
+ private static final Logger LOGGER = LoggerFactory.getLogger(SCLTypeUtils.class);
private static final THashMap<String, Type> TYPE_MAP = new THashMap<String, Type>();
private static void add(TCon type) {
public static Type getType(String typeText) {
Type type = TYPE_MAP.get(typeText);
if(type == null) {
- System.err.println("SCLTypeUtils.getType cannot transform '" + typeText + "' to type. Returns a as default.");
+ LOGGER.warn("SCLTypeUtils.getType cannot transform '" + typeText + "' to type. Returns a as default.");
return Types.var(Kinds.STAR);
}
return type;
else if(dataType instanceof ArrayType)
return Types.list(getType(((ArrayType)dataType).componentType));
else {
- System.err.println("SCLTypeUtils.getType cannot transform data type '" + dataType + "' to type. Returns a as default.");
+ LOGGER.warn("SCLTypeUtils.getType cannot transform data type '" + dataType + "' to type. Returns a as default.");
return Types.var(Kinds.STAR);
}
}
else if(propertyInfo.requiredDatatype != null)
return getType(propertyInfo.requiredDatatype);
else {
- System.err.println(propertyInfo.name + " doesn't have type information. Returns a as default.");
+ LOGGER.warn(propertyInfo.name + " doesn't have type information. Returns a as default.");
return Types.var(Kinds.STAR);
}
}