Fix RuntimeTypeAdapterFactory javadoc

This commit is contained in:
Egor N 2016-02-19 16:14:55 +02:00
parent 02838e1e30
commit edaf59e178

View File

@ -94,11 +94,11 @@ import com.google.gson.stream.JsonWriter;
* "Rectangle"}) are configurable. * "Rectangle"}) are configurable.
* *
* <h3>Registering Types</h3> * <h3>Registering Types</h3>
* Create a {@code RuntimeTypeAdapter} by passing the base type and type field * Create a {@code RuntimeTypeAdapterFactory} by passing the base type and type field
* name to the {@link #of} factory method. If you don't supply an explicit type * name to the {@link #of} factory method. If you don't supply an explicit type
* field name, {@code "type"} will be used. <pre> {@code * field name, {@code "type"} will be used. <pre> {@code
* RuntimeTypeAdapter<Shape> shapeAdapter * RuntimeTypeAdapterFactory<Shape> shapeAdapter
* = RuntimeTypeAdapter.of(Shape.class, "type"); * = RuntimeTypeAdapterFactory.of(Shape.class, "type");
* }</pre> * }</pre>
* Next register all of your subtypes. Every subtype must be explicitly * Next register all of your subtypes. Every subtype must be explicitly
* registered. This protects your application from injection attacks. If you * registered. This protects your application from injection attacks. If you
@ -115,7 +115,7 @@ import com.google.gson.stream.JsonWriter;
* .create(); * .create();
* }</pre> * }</pre>
* Like {@code GsonBuilder}, this API supports chaining: <pre> {@code * Like {@code GsonBuilder}, this API supports chaining: <pre> {@code
* RuntimeTypeAdapter<Shape> shapeAdapter = RuntimeTypeAdapterFactory.of(Shape.class) * RuntimeTypeAdapterFactory<Shape> shapeAdapter = RuntimeTypeAdapterFactory.of(Shape.class)
* .registerSubtype(Rectangle.class) * .registerSubtype(Rectangle.class)
* .registerSubtype(Circle.class) * .registerSubtype(Circle.class)
* .registerSubtype(Diamond.class); * .registerSubtype(Diamond.class);