Add @since tags.

This commit is contained in:
Jesse Wilson 2011-12-02 23:11:28 +00:00
parent 26ab404599
commit 8f8e69a364
3 changed files with 10 additions and 0 deletions

View File

@ -366,6 +366,7 @@ public final class Gson {
* *
* @throws IllegalArgumentException if this GSON cannot serialize and * @throws IllegalArgumentException if this GSON cannot serialize and
* deserialize {@code type}. * deserialize {@code type}.
* @since 2.1
*/ */
public <T> TypeAdapter<T> getNextAdapter(TypeAdapter.Factory skipPast, TypeToken<T> type) { public <T> TypeAdapter<T> getNextAdapter(TypeAdapter.Factory skipPast, TypeToken<T> type) {
boolean skipPastFound = false; boolean skipPastFound = false;

View File

@ -468,6 +468,8 @@ public final class GsonBuilder {
* adapter needs to be configured based on the type of the field being processed. Gson * adapter needs to be configured based on the type of the field being processed. Gson
* is designed to handle a large number of factories, so you should consider registering * is designed to handle a large number of factories, so you should consider registering
* them to be at par with registering an individual type adapter. * them to be at par with registering an individual type adapter.
*
* @since 2.1
*/ */
public GsonBuilder registerTypeAdapterFactory(TypeAdapter.Factory factory) { public GsonBuilder registerTypeAdapterFactory(TypeAdapter.Factory factory) {
factories.add(factory); factories.add(factory);

View File

@ -29,6 +29,10 @@ import java.io.Writer;
// TODO: nice documentation // TODO: nice documentation
/**
*
* @since 2.1
*/
public abstract class TypeAdapter<T> { public abstract class TypeAdapter<T> {
public abstract T read(JsonReader reader) throws IOException; public abstract T read(JsonReader reader) throws IOException;
public abstract void write(JsonWriter writer, T value) throws IOException; public abstract void write(JsonWriter writer, T value) throws IOException;
@ -75,6 +79,9 @@ public abstract class TypeAdapter<T> {
} }
} }
/**
* @since 2.1
*/
public interface Factory { public interface Factory {
<T> TypeAdapter<T> create(Gson gson, TypeToken<T> type); <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type);
} }