Skip to content

Commit

Permalink
Better javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Cron committed Oct 6, 2015
1 parent 21d7f06 commit b395da2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
* You can specify which case representation is used for the proto fields when writing/reading the
* JSON payload by calling {@link Builder#setFieldNameSerializationFormat(CaseFormat, CaseFormat)}.
* <p>
* An example of default serialization/deserialization using custom proto field names is show below:
* An example of default serialization/deserialization using custom proto field names is shown
* below:
*
* <pre>
* message MyMessage {
Expand Down Expand Up @@ -130,16 +131,15 @@ public Builder setFieldNameSerializationFormat(CaseFormat fromFieldNameFormat,

/**
* Adds a field proto annotation that, when set, overrides the default field name
* serialization/deserialization. For example, if you add the ' {@code serialized_name}'
* serialization/deserialization. For example, if you add the '{@code serialized_name}'
* annotation and you define a field in your proto like the one below:
*
* <pre>
* string client_app_id = 1[(serialized_name) = "appId"];
* string client_app_id = 1 [(serialized_name) = "appId"];
* </pre>
*
* ...the adapter will serialize the field using '{@code appId}' instead of the default '
* {@code clientAppId}'. This lets you customize the name serialization of any field of your
* proto.
* {@code clientAppId}'. This lets you customize the name serialization of any proto field.
*/
public Builder addSerializedNameExtension(
Extension<FieldOptions, String> serializedNameExtension) {
Expand All @@ -148,8 +148,8 @@ public Builder addSerializedNameExtension(
}

/**
* Adds an enum proto annotation that, when set, overrides the default <b>enum</b> value
* serialization/deerialization of this adapter. For example, if you add the '
* Adds an enum value proto annotation that, when set, overrides the default <b>enum</b> value
* serialization/deserialization of this adapter. For example, if you add the '
* {@code serialized_value}' annotation and you define an enum in your proto like the one below:
*
* <pre>
Expand Down Expand Up @@ -297,7 +297,7 @@ public GeneratedMessage deserialize(JsonElement json, Type typeOfT,
return (GeneratedMessage) protoBuilder.build();
} catch (SecurityException e) {
throw new JsonParseException(e);
} catch (NoSuchMethodException e) {
} catch (NoSuchMethodException e) {
throw new JsonParseException(e);
} catch (IllegalArgumentException e) {
throw new JsonParseException(e);
Expand Down
2 changes: 1 addition & 1 deletion proto/src/main/protobuf/annotations.proto
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ extend google.protobuf.FieldOptions {
extend google.protobuf.EnumValueOptions {
// Indicates a field value that overrides the default for serialization
optional string serialized_value = 92066888;
}
}

0 comments on commit b395da2

Please sign in to comment.