Tabnine Logo
Gson.assertFullConsumption
Code IndexAdd Tabnine to your IDE (free)

How to use
assertFullConsumption
method
in
com.google.gson.Gson

Best Java code snippets using com.google.gson.Gson.assertFullConsumption (Showing top 16 results out of 315)

origin: camunda/camunda-bpm-platform

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified type. This method is useful if the specified object is a generic type. For
 * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
 * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing Json from which the object is to be deserialized
 * @param typeOfT The specific genericized type of src. You can obtain this type by using the
 * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
 * {@code Collection<Foo>}, you should use:
 * <pre>
 * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
 * </pre>
 * @return an object of type T from the json. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
@SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
 JsonReader jsonReader = newJsonReader(json);
 T object = (T) fromJson(jsonReader, typeOfT);
 assertFullConsumption(object, jsonReader);
 return object;
}
origin: camunda/camunda-bpm-platform

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified class. It is not suitable to use if the specified class is a generic type since it
 * will not have the generic type information because of the Type Erasure feature of Java.
 * Therefore, this method should not be used if the desired type is a generic type. Note that
 * this method works fine if the any of the fields of the specified object are generics, just the
 * object itself should not be a generic type. For the cases when the object is of generic type,
 * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
 * {@link Reader}, use {@link #fromJson(String, Class)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing the Json from which the object is to be deserialized.
 * @param classOfT the class of T
 * @return an object of type T from the string. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
 JsonReader jsonReader = newJsonReader(json);
 Object object = fromJson(jsonReader, classOfT);
 assertFullConsumption(object, jsonReader);
 return Primitives.wrap(classOfT).cast(object);
}
origin: Odoo-mobile/framework

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified type. This method is useful if the specified object is a generic type. For
 * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
 * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing Json from which the object is to be deserialized
 * @param typeOfT The specific genericized type of src. You can obtain this type by using the
 * {@link TypeToken} class. For example, to get the type for
 * {@code Collection<Foo>}, you should use:
 * <pre>
 * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
 * </pre>
 * @return an object of type T from the json. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
@SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
 JsonReader jsonReader = new JsonReader(json);
 T object = (T) fromJson(jsonReader, typeOfT);
 assertFullConsumption(object, jsonReader);
 return object;
}
origin: at.bestsolution.efxclipse.eclipse/com.google.gson

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified type. This method is useful if the specified object is a generic type. For
 * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
 * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing Json from which the object is to be deserialized
 * @param typeOfT The specific genericized type of src. You can obtain this type by using the
 * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
 * {@code Collection<Foo>}, you should use:
 * <pre>
 * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
 * </pre>
 * @return an object of type T from the json
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
@SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
 JsonReader jsonReader = new JsonReader(json);
 T object = (T) fromJson(jsonReader, typeOfT);
 assertFullConsumption(object, jsonReader);
 return object;
}
origin: Nextdoor/bender

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified type. This method is useful if the specified object is a generic type. For
 * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
 * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing Json from which the object is to be deserialized
 * @param typeOfT The specific genericized type of src. You can obtain this type by using the
 * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
 * {@code Collection<Foo>}, you should use:
 * <pre>
 * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
 * </pre>
 * @return an object of type T from the json. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
@SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
 JsonReader jsonReader = new JsonReader(json);
 T object = (T) fromJson(jsonReader, typeOfT);
 assertFullConsumption(object, jsonReader);
 return object;
}
origin: com.google/gson

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified type. This method is useful if the specified object is a generic type. For
 * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
 * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing Json from which the object is to be deserialized
 * @param typeOfT The specific genericized type of src. You can obtain this type by using the
 * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
 * {@code Collection<Foo>}, you should use:
 * <pre>
 * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
 * </pre>
 * @return an object of type T from the json
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
@SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
 JsonReader jsonReader = new JsonReader(json);
 T object = (T) fromJson(jsonReader, typeOfT);
 assertFullConsumption(object, jsonReader);
 return object;
}
origin: eatnumber1/google-gson

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified type. This method is useful if the specified object is a generic type. For
 * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
 * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing Json from which the object is to be deserialized
 * @param typeOfT The specific genericized type of src. You can obtain this type by using the
 * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
 * {@code Collection<Foo>}, you should use:
 * <pre>
 * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
 * </pre>
 * @return an object of type T from the json
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
 JsonReader jsonReader = new JsonReader(json);
 T object = this.<T>fromJson(jsonReader, typeOfT);
 assertFullConsumption(object, jsonReader);
 return object;
}
origin: fesch/CanZE

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified type. This method is useful if the specified object is a generic type. For
 * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
 * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing Json from which the object is to be deserialized
 * @param typeOfT The specific genericized type of src. You can obtain this type by using the
 * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
 * {@code Collection<Foo>}, you should use:
 * <pre>
 * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
 * </pre>
 * @return an object of type T from the json. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
@SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
 JsonReader jsonReader = new JsonReader(json);
 T object = (T) fromJson(jsonReader, typeOfT);
 assertFullConsumption(object, jsonReader);
 return object;
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified type. This method is useful if the specified object is a generic type. For
 * non-generic objects, use {@link #fromJson(Reader, Class)} instead. If you have the Json in a
 * String form instead of a {@link Reader}, use {@link #fromJson(String, Type)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing Json from which the object is to be deserialized
 * @param typeOfT The specific genericized type of src. You can obtain this type by using the
 * {@link com.google.gson.reflect.TypeToken} class. For example, to get the type for
 * {@code Collection<Foo>}, you should use:
 * <pre>
 * Type typeOfT = new TypeToken&lt;Collection&lt;Foo&gt;&gt;(){}.getType();
 * </pre>
 * @return an object of type T from the json. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
@SuppressWarnings("unchecked")
public <T> T fromJson(Reader json, Type typeOfT) throws JsonIOException, JsonSyntaxException {
 JsonReader jsonReader = newJsonReader(json);
 T object = (T) fromJson(jsonReader, typeOfT);
 assertFullConsumption(object, jsonReader);
 return object;
}
origin: com.google/gson

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified class. It is not suitable to use if the specified class is a generic type since it
 * will not have the generic type information because of the Type Erasure feature of Java.
 * Therefore, this method should not be used if the desired type is a generic type. Note that
 * this method works fine if the any of the fields of the specified object are generics, just the
 * object itself should not be a generic type. For the cases when the object is of generic type,
 * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
 * {@link Reader}, use {@link #fromJson(String, Class)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing the Json from which the object is to be deserialized.
 * @param classOfT the class of T
 * @return an object of type T from the string
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
 JsonReader jsonReader = new JsonReader(json);
 Object object = fromJson(jsonReader, classOfT);
 assertFullConsumption(object, jsonReader);
 return Primitives.wrap(classOfT).cast(object);
}
origin: Odoo-mobile/framework

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified class. It is not suitable to use if the specified class is a generic type since it
 * will not have the generic type information because of the Type Erasure feature of Java.
 * Therefore, this method should not be used if the desired type is a generic type. Note that
 * this method works fine if the any of the fields of the specified object are generics, just the
 * object itself should not be a generic type. For the cases when the object is of generic type,
 * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
 * {@link Reader}, use {@link #fromJson(String, Class)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing the Json from which the object is to be deserialized.
 * @param classOfT the class of T
 * @return an object of type T from the string. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
 JsonReader jsonReader = new JsonReader(json);
 Object object = fromJson(jsonReader, classOfT);
 assertFullConsumption(object, jsonReader);
 return Primitives.wrap(classOfT).cast(object);
}
origin: at.bestsolution.efxclipse.eclipse/com.google.gson

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified class. It is not suitable to use if the specified class is a generic type since it
 * will not have the generic type information because of the Type Erasure feature of Java.
 * Therefore, this method should not be used if the desired type is a generic type. Note that
 * this method works fine if the any of the fields of the specified object are generics, just the
 * object itself should not be a generic type. For the cases when the object is of generic type,
 * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
 * {@link Reader}, use {@link #fromJson(String, Class)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing the Json from which the object is to be deserialized.
 * @param classOfT the class of T
 * @return an object of type T from the string
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
 JsonReader jsonReader = new JsonReader(json);
 Object object = fromJson(jsonReader, classOfT);
 assertFullConsumption(object, jsonReader);
 return Primitives.wrap(classOfT).cast(object);
}
origin: Nextdoor/bender

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified class. It is not suitable to use if the specified class is a generic type since it
 * will not have the generic type information because of the Type Erasure feature of Java.
 * Therefore, this method should not be used if the desired type is a generic type. Note that
 * this method works fine if the any of the fields of the specified object are generics, just the
 * object itself should not be a generic type. For the cases when the object is of generic type,
 * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
 * {@link Reader}, use {@link #fromJson(String, Class)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing the Json from which the object is to be deserialized.
 * @param classOfT the class of T
 * @return an object of type T from the string. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
 JsonReader jsonReader = new JsonReader(json);
 Object object = fromJson(jsonReader, classOfT);
 assertFullConsumption(object, jsonReader);
 return Primitives.wrap(classOfT).cast(object);
}
origin: fesch/CanZE

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified class. It is not suitable to use if the specified class is a generic type since it
 * will not have the generic type information because of the Type Erasure feature of Java.
 * Therefore, this method should not be used if the desired type is a generic type. Note that
 * this method works fine if the any of the fields of the specified object are generics, just the
 * object itself should not be a generic type. For the cases when the object is of generic type,
 * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
 * {@link Reader}, use {@link #fromJson(String, Class)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing the Json from which the object is to be deserialized.
 * @param classOfT the class of T
 * @return an object of type T from the string. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
 JsonReader jsonReader = new JsonReader(json);
 Object object = fromJson(jsonReader, classOfT);
 assertFullConsumption(object, jsonReader);
 return Primitives.wrap(classOfT).cast(object);
}
origin: eatnumber1/google-gson

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified class. It is not suitable to use if the specified class is a generic type since it
 * will not have the generic type information because of the Type Erasure feature of Java.
 * Therefore, this method should not be used if the desired type is a generic type. Note that
 * this method works fine if the any of the fields of the specified object are generics, just the
 * object itself should not be a generic type. For the cases when the object is of generic type,
 * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
 * {@link Reader}, use {@link #fromJson(String, Class)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing the Json from which the object is to be deserialized.
 * @param classOfT the class of T
 * @return an object of type T from the string
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
 JsonReader jsonReader = new JsonReader(json);
 Object object = fromJson(jsonReader, classOfT);
 assertFullConsumption(object, jsonReader);
 return Primitives.wrap(classOfT).cast(object);
}
origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * This method deserializes the Json read from the specified reader into an object of the
 * specified class. It is not suitable to use if the specified class is a generic type since it
 * will not have the generic type information because of the Type Erasure feature of Java.
 * Therefore, this method should not be used if the desired type is a generic type. Note that
 * this method works fine if the any of the fields of the specified object are generics, just the
 * object itself should not be a generic type. For the cases when the object is of generic type,
 * invoke {@link #fromJson(Reader, Type)}. If you have the Json in a String form instead of a
 * {@link Reader}, use {@link #fromJson(String, Class)} instead.
 *
 * @param <T> the type of the desired object
 * @param json the reader producing the Json from which the object is to be deserialized.
 * @param classOfT the class of T
 * @return an object of type T from the string. Returns {@code null} if {@code json} is at EOF.
 * @throws JsonIOException if there was a problem reading from the Reader
 * @throws JsonSyntaxException if json is not a valid representation for an object of type
 * @since 1.2
 */
public <T> T fromJson(Reader json, Class<T> classOfT) throws JsonSyntaxException, JsonIOException {
 JsonReader jsonReader = newJsonReader(json);
 Object object = fromJson(jsonReader, classOfT);
 assertFullConsumption(object, jsonReader);
 return Primitives.wrap(classOfT).cast(object);
}
com.google.gsonGsonassertFullConsumption

Popular methods of Gson

  • fromJson
    This method deserializes the specified Json into an object of the specified type. This method is use
  • toJson
    This method serializes the specified object, including those of generic types, into its equivalent J
  • <init>
  • toJsonTree
    This method serializes the specified object, including those of generic types, into its equivalent r
  • getAdapter
    Returns the type adapter for type.
  • getDelegateAdapter
    This method is used to get an alternate type adapter for the specified type. This is used to access
  • newJsonWriter
    Returns a new JSON writer configured for this GSON and with the non-execute prefix if that is config
  • newJsonReader
    Returns a new JSON reader configured for the settings on this Gson instance.
  • doubleAdapter
  • floatAdapter
  • longAdapter
  • fieldNamingStrategy
  • longAdapter,
  • fieldNamingStrategy,
  • toString,
  • atomicLongAdapter,
  • atomicLongArrayAdapter,
  • checkValidFloatingPoint,
  • excluder,
  • newBuilder,
  • fromGson

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
  • runOnUiThread (Activity)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • BufferedInputStream (java.io)
    A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the i
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JLabel (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now