本文整理匯總了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);
}