public static PropertyInfo convert(String keyString, String propertyName, Integer index,
Object obj, List<String> warnings) {
PropertyInfo result = null;
if (obj == null) {
result = new NullPropertyInfo();
} else if (obj instanceof Boolean) {
result = new BooleanPropertyInfo((Boolean)obj);
} else if (obj instanceof String) {
result = new StringPropertyInfo((String)obj);
} else if (obj instanceof Category) {