This commit is contained in:
@@ -128,16 +128,19 @@ public final class JsonConvert extends TextConvert<JsonReader, JsonWriter> {
|
|||||||
return rs;
|
return rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回非null的值是由String、ArrayList、HashMap任意组合的对象
|
||||||
public <V> V convertFrom(final String text) {
|
public <V> V convertFrom(final String text) {
|
||||||
if (text == null) return null;
|
if (text == null) return null;
|
||||||
return (V) convertFrom(Utility.charArray(text));
|
return (V) convertFrom(Utility.charArray(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回非null的值是由String、ArrayList、HashMap任意组合的对象
|
||||||
public <V> V convertFrom(final char[] text) {
|
public <V> V convertFrom(final char[] text) {
|
||||||
if (text == null) return null;
|
if (text == null) return null;
|
||||||
return (V) convertFrom(text, 0, text.length);
|
return (V) convertFrom(text, 0, text.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回非null的值是由String、ArrayList、HashMap任意组合的对象
|
||||||
public <V> V convertFrom(final char[] text, final int start, final int len) {
|
public <V> V convertFrom(final char[] text, final int start, final int len) {
|
||||||
if (text == null) return null;
|
if (text == null) return null;
|
||||||
final JsonReader in = readerPool.get();
|
final JsonReader in = readerPool.get();
|
||||||
@@ -147,21 +150,25 @@ public final class JsonConvert extends TextConvert<JsonReader, JsonWriter> {
|
|||||||
return (V) rs;
|
return (V) rs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回非null的值是由String、ArrayList、HashMap任意组合的对象
|
||||||
public <V> V convertFrom(final InputStream in) {
|
public <V> V convertFrom(final InputStream in) {
|
||||||
if (in == null) return null;
|
if (in == null) return null;
|
||||||
return (V) new AnyDecoder(factory).convertFrom(new JsonStreamReader(in));
|
return (V) new AnyDecoder(factory).convertFrom(new JsonStreamReader(in));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回非null的值是由String、ArrayList、HashMap任意组合的对象
|
||||||
public <V> V convertFrom(final ByteBuffer... buffers) {
|
public <V> V convertFrom(final ByteBuffer... buffers) {
|
||||||
if (buffers == null || buffers.length == 0) return null;
|
if (buffers == null || buffers.length == 0) return null;
|
||||||
return (V) new AnyDecoder(factory).convertFrom(new JsonByteBufferReader((ConvertMask) null, buffers));
|
return (V) new AnyDecoder(factory).convertFrom(new JsonByteBufferReader((ConvertMask) null, buffers));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回非null的值是由String、ArrayList、HashMap任意组合的对象
|
||||||
public <V> V convertFrom(final ConvertMask mask, final ByteBuffer... buffers) {
|
public <V> V convertFrom(final ConvertMask mask, final ByteBuffer... buffers) {
|
||||||
if (buffers == null || buffers.length == 0) return null;
|
if (buffers == null || buffers.length == 0) return null;
|
||||||
return (V) new AnyDecoder(factory).convertFrom(new JsonByteBufferReader(mask, buffers));
|
return (V) new AnyDecoder(factory).convertFrom(new JsonByteBufferReader(mask, buffers));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//返回非null的值是由String、ArrayList、HashMap任意组合的对象
|
||||||
public <V> V convertFrom(final JsonReader reader) {
|
public <V> V convertFrom(final JsonReader reader) {
|
||||||
if (reader == null) return null;
|
if (reader == null) return null;
|
||||||
return (V) new AnyDecoder(factory).convertFrom(reader);
|
return (V) new AnyDecoder(factory).convertFrom(reader);
|
||||||
|
|||||||
Reference in New Issue
Block a user