
net.arccode.wechat.pay.api.common.util.json.JSONValidatingReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wechat-pay-sdk Show documentation
Show all versions of wechat-pay-sdk Show documentation
wechat pay SDK, out of the box.
The newest version!
package net.arccode.wechat.pay.api.common.util.json;
public class JSONValidatingReader extends JSONReader {
public static final Object INVALID = new Object();
private JSONValidator validator;
public JSONValidatingReader(JSONValidator validator) {
this.validator = validator;
}
public JSONValidatingReader(JSONErrorListener listener) {
this(new JSONValidator(listener));
}
public JSONValidatingReader() {
this(new StdoutStreamErrorListener());
}
public Object read(String string) {
if (!validator.validate(string)) return INVALID;
return super.read(string);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy