/** Marshall the given parameter object, and output to a JSONWriter */ public void marshall(Artifact artifact, JSONWriter jsonWriter) { if (artifact == null) { throw new AmazonClientException("Invalid argument passed to marshall(...)"); } try { jsonWriter.object(); if (artifact.getName() != null) { jsonWriter.key("name").value(artifact.getName()); } if (artifact.getRevision() != null) { jsonWriter.key("revision").value(artifact.getRevision()); } if (artifact.getLocation() != null) { jsonWriter.key("location"); ArtifactLocationJsonMarshaller.getInstance().marshall(artifact.getLocation(), jsonWriter); } jsonWriter.endObject(); } catch (Throwable t) { throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t); } }