/** * Returns a binary content builder for the provided content type. */ public static XContentBuilder contentBuilder(XContentType type) throws IOException { if (type == XContentType.JSON) { return JsonXContent.contentBuilder(); } else if (type == XContentType.SMILE) { return SmileXContent.contentBuilder(); } else if (type == XContentType.YAML) { return YamlXContent.contentBuilder(); } else if (type == XContentType.CBOR) { return CborXContent.contentBuilder(); } throw new IllegalArgumentException("No matching content type for " + type); }
/** * Constructs a new json builder that will output the result into the provided output stream. */ public static XContentBuilder smileBuilder(OutputStream os) throws IOException { return new XContentBuilder(SmileXContent.smileXContent, os); }
/** * Constructs a new json builder that will output the result into the provided output stream. */ public static XmlXContentBuilder smileBuilder(OutputStream os) throws IOException { return new XmlXContentBuilder(SmileXContent.smileXContent, os); }