本文整理汇总了Java中com.dslplatform.json.JsonReader类的典型用法代码示例。如果您正苦于以下问题:Java JsonReader类的具体用法?Java JsonReader怎么用?Java JsonReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JsonReader类属于com.dslplatform.json包,在下文中一共展示了JsonReader类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import com.dslplatform.json.JsonReader; //导入依赖的package包/类
@Override
public Object parse(String source) throws Exception {
byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
if (bytes[0] == '{') {
return mapper.deserialize(LinkedHashMap.class, bytes, bytes.length);
}
if (bytes[0] == '[') {
JsonReader<Object> reader = mapper.newReader(bytes, bytes.length);
reader.getNextToken();
return ObjectConverter.deserializeList(reader);
}
throw new IllegalArgumentException("Malformed JSON: " + source);
}
示例2: deserialize
import com.dslplatform.json.JsonReader; //导入依赖的package包/类
public static TreePath deserialize(final JsonReader reader) throws IOException {
try {
return TreePath.create(reader.readString());
} catch(final IOException e) {
throw new IOException("Can't parse JSON TreePath at position " + reader.positionInStream(), e);
}
}
示例3: deserialize
import com.dslplatform.json.JsonReader; //导入依赖的package包/类
@Override
public ImplProper deserialize(JsonReader reader) throws IOException {
return null;
}
示例4: read
import com.dslplatform.json.JsonReader; //导入依赖的package包/类
@Override
public TreePath read(JsonReader reader) throws IOException {
return TreePathConverter.deserialize(reader);
}
示例5: deserializeCollection
import com.dslplatform.json.JsonReader; //导入依赖的package包/类
public static ArrayList<TreePath> deserializeCollection(final JsonReader reader) throws IOException {
return reader.deserializeCollection(Reader);
}
示例6: deserializeNullableCollection
import com.dslplatform.json.JsonReader; //导入依赖的package包/类
public static ArrayList<TreePath> deserializeNullableCollection(final JsonReader reader) throws IOException {
return reader.deserializeNullableCollection(Reader);
}