提交 478e1ddf 编写于 作者: T Todd Huss

Provide a setter to set strict mode to false

上级 e59a26ce
......@@ -23,6 +23,8 @@ public class SimpleXMLConverter implements Converter {
private final Serializer serializer;
private boolean strict = true;
public SimpleXMLConverter() {
this(new Persister());
}
......@@ -33,7 +35,7 @@ public class SimpleXMLConverter implements Converter {
@Override public Object fromBody(TypedInput body, Type type) throws ConversionException {
try {
return serializer.read((Class<?>) type, body.in());
return serializer.read((Class<?>) type, body.in(), strict);
} catch (Exception e) {
throw new ConversionException(e);
}
......@@ -60,4 +62,13 @@ public class SimpleXMLConverter implements Converter {
}
}
}
public boolean isStrict() {
return strict;
}
public void setStrict(boolean strict) {
this.strict = strict;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册