Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.10] Support Smithy IDL Serialization #284

Merged
merged 16 commits into from
Feb 27, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Privatize everything that can be
  • Loading branch information
JordonPhillips committed Feb 24, 2020
commit 9ef38f40b941a7029d36c403f889d0a60aa5a645
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private static final class NodeSerializer {
*
* @param node The node to serialize.
*/
public void serialize(Node node) {
private void serialize(Node node) {
serialize(node, null);
}

Expand All @@ -515,7 +515,7 @@ public void serialize(Node node) {
* @param node The node to serialize.
* @param shape The shape of the node.
*/
public void serialize(Node node, Shape shape) {
private void serialize(Node node, Shape shape) {
// ShapeIds are represented differently than strings, so if a shape looks like it's
// representing a shapeId we need to serialize it without quotes.
if (isShapeId(shape)) {
Expand Down Expand Up @@ -621,7 +621,7 @@ private void serializeObject(ObjectNode node, Shape shape) {
* @param node The node to serialize.
* @param shape The shape of the node.
*/
public void serializeKeyValuePairs(ObjectNode node, Shape shape) {
private void serializeKeyValuePairs(ObjectNode node, Shape shape) {
if (node.isEmpty()) {
return;
}
Expand Down Expand Up @@ -682,15 +682,15 @@ private static final class SmithyCodeWriter extends CodeWriter {
/**
* Opens a block without writing indentation whitespace or inserting a newline.
*/
public SmithyCodeWriter openBlockInline(String content, Object... args) {
private SmithyCodeWriter openBlockInline(String content, Object... args) {
writeInline(content, args).indent();
return this;
}

/**
* Closes a block without inserting a newline.
*/
public SmithyCodeWriter closeBlockWithoutNewline(String content, Object... args) {
private SmithyCodeWriter closeBlockWithoutNewline(String content, Object... args) {
setNewline("");
closeBlock(content, args);
setNewline("\n");
Expand All @@ -702,7 +702,7 @@ public SmithyCodeWriter closeBlockWithoutNewline(String content, Object... args)
*
* <p> This does not insert a trailing newline.
*/
public SmithyCodeWriter writeIndent() {
private SmithyCodeWriter writeIndent() {
setNewline("");
JordonPhillips marked this conversation as resolved.
Show resolved Hide resolved
// We explicitly want the trailing spaces, so disable trimming for this call.
trimTrailingSpaces(false);
Expand Down Expand Up @@ -763,7 +763,7 @@ private boolean conflictsWithImports(ShapeId shapeId) {
*
* <p>If the list is empty, nothing is written.
*/
public SmithyCodeWriter writeOptionalIdList(String textBeforeList, Collection<ShapeId> shapeIds) {
private SmithyCodeWriter writeOptionalIdList(String textBeforeList, Collection<ShapeId> shapeIds) {
if (shapeIds.isEmpty()) {
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ namespace ns.foo

/// Documentation comments are used.
/// $ is escaped
/// /// doesn't need to be escaped
string Foo