mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 00:19:21 +08:00
@@ -26,7 +26,7 @@ import java.util.List;
|
|||||||
* Converts arrays to JSON arrays containing their converted contents. This
|
* Converts arrays to JSON arrays containing their converted contents. This
|
||||||
* supports both primitive and object arrays.
|
* supports both primitive and object arrays.
|
||||||
*/
|
*/
|
||||||
class ArrayJsonAdapter extends JsonAdapter<Object> {
|
final class ArrayJsonAdapter extends JsonAdapter<Object> {
|
||||||
public static final Factory FACTORY = new Factory() {
|
public static final Factory FACTORY = new Factory() {
|
||||||
@Override public JsonAdapter<?> create(Type type, AnnotatedElement annotations, Moshi moshi) {
|
@Override public JsonAdapter<?> create(Type type, AnnotatedElement annotations, Moshi moshi) {
|
||||||
Type elementType = Types.arrayComponentType(type);
|
Type elementType = Types.arrayComponentType(type);
|
||||||
|
@@ -173,7 +173,7 @@ import okio.Source;
|
|||||||
* <p>Each {@code JsonReader} may be used to read a single JSON stream. Instances
|
* <p>Each {@code JsonReader} may be used to read a single JSON stream. Instances
|
||||||
* of this class are not thread safe.
|
* of this class are not thread safe.
|
||||||
*/
|
*/
|
||||||
public class JsonReader implements Closeable {
|
public final class JsonReader implements Closeable {
|
||||||
private static final long MIN_INCOMPLETE_INTEGER = Long.MIN_VALUE / 10;
|
private static final long MIN_INCOMPLETE_INTEGER = Long.MIN_VALUE / 10;
|
||||||
|
|
||||||
private static final ByteString SINGLE_QUOTE_OR_SLASH = ByteString.encodeUtf8("'\\");
|
private static final ByteString SINGLE_QUOTE_OR_SLASH = ByteString.encodeUtf8("'\\");
|
||||||
|
@@ -124,7 +124,7 @@ import static com.squareup.moshi.JsonScope.NONEMPTY_OBJECT;
|
|||||||
* Instances of this class are not thread safe. Calls that would result in a
|
* Instances of this class are not thread safe. Calls that would result in a
|
||||||
* malformed JSON string will fail with an {@link IllegalStateException}.
|
* malformed JSON string will fail with an {@link IllegalStateException}.
|
||||||
*/
|
*/
|
||||||
public class JsonWriter implements Closeable, Flushable {
|
public final class JsonWriter implements Closeable, Flushable {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* From RFC 4627, "All Unicode characters may be placed within the
|
* From RFC 4627, "All Unicode characters may be placed within the
|
||||||
|
Reference in New Issue
Block a user