Thanks go to @fge who provided the necessary information for me to solve this.
Here's what I did to solve this problem!
JsonNodeFactory nodeFactory = new JsonNodeFactory();
ObjectNode pushContent = nodeFactory.objectNode();
ObjectNode notification = nodeFactory.objectNode();
ObjectNode appsObj = nodeFactory.objectNode();
ObjectNode target = nodeFactory.objectNode();
ArrayNode apps = nodeFactory.arrayNode();
ArrayNode platforms = nodeFactory.arrayNode();
platforms.add("ios");
appsObj.put("id","app_id");
appsObj.put("platforms",platforms);
apps.add(appsObj);
notification.put("message",filledForm.field("text").value());
notification.put("sound","sounds/alarmsound.wav");
notification.put("target", target);
target.put("apps",apps);
pushContent.put("notification", notification);
pushContent.put("access_token","access_token");
if(!filledForm.field("usage").value().isEmpty()) {
target.put("usage",filledForm.field("usage").value());
}
if(!filledForm.field("latitude").value().isEmpty() && !filledForm.field("longitude").value().isEmpty() && !filledForm.field("radius").value().isEmpty()) {
target.put("latitude",filledForm.field("latitude").value());
target.put("longitude",filledForm.field("longitude").value());
target.put("radius",filledForm.field("radius").value());
}
Printing pushContent than outputs the exact json object I needed to create!
Hope this helps someone else out there too!
Rich