public class XContentFactory
extends java.lang.Object
XContent
and XContentBuilder
.Constructor and Description |
---|
XContentFactory() |
Modifier and Type | Method and Description |
---|---|
static XContentBuilder |
cborBuilder()
Returns a content builder using CBOR format (
XContentType.CBOR . |
static XContentBuilder |
cborBuilder(java.io.OutputStream os)
Constructs a new cbor builder that will output the result into the provided output stream.
|
static XContentBuilder |
contentBuilder(XContentType type)
Returns a binary content builder for the provided content type.
|
static XContentBuilder |
contentBuilder(XContentType type,
java.io.OutputStream outputStream)
Constructs a xcontent builder that will output the result into the provided output stream.
|
static XContentBuilder |
jsonBuilder()
Returns a content builder using JSON format (
XContentType.JSON . |
static XContentBuilder |
jsonBuilder(java.io.OutputStream os)
Constructs a new json builder that will output the result into the provided output stream.
|
static XContentBuilder |
smileBuilder()
Returns a content builder using SMILE format (
XContentType.SMILE . |
static XContentBuilder |
smileBuilder(java.io.OutputStream os)
Constructs a new json builder that will output the result into the provided output stream.
|
static XContent |
xContent(byte[] data)
Guesses the content type based on the provided bytes.
|
static XContent |
xContent(byte[] data,
int offset,
int length)
Guesses the content type based on the provided bytes.
|
static XContent |
xContent(BytesReference bytes) |
static XContent |
xContent(java.lang.CharSequence content)
Guesses the content (type) based on the provided char sequence.
|
static XContent |
xContent(XContentType type)
Returns the
XContent for the provided content type. |
static XContentType |
xContentType(byte[] data)
Guesses the content type based on the provided bytes.
|
static XContentType |
xContentType(byte[] data,
int offset,
int length)
Guesses the content type based on the provided bytes.
|
static XContentType |
xContentType(BytesReference bytes)
Guesses the content type based on the provided bytes.
|
static XContentType |
xContentType(java.lang.CharSequence content)
Guesses the content type based on the provided char sequence.
|
static XContentType |
xContentType(java.io.InputStream si)
Guesses the content type based on the provided input stream without consuming it.
|
static XContentBuilder |
yamlBuilder()
Returns a content builder using YAML format (
XContentType.YAML . |
static XContentBuilder |
yamlBuilder(java.io.OutputStream os)
Constructs a new yaml builder that will output the result into the provided output stream.
|
public static XContentBuilder jsonBuilder() throws java.io.IOException
XContentType.JSON
.java.io.IOException
public static XContentBuilder jsonBuilder(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public static XContentBuilder smileBuilder() throws java.io.IOException
XContentType.SMILE
.java.io.IOException
public static XContentBuilder smileBuilder(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public static XContentBuilder yamlBuilder() throws java.io.IOException
XContentType.YAML
.java.io.IOException
public static XContentBuilder yamlBuilder(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public static XContentBuilder cborBuilder() throws java.io.IOException
XContentType.CBOR
.java.io.IOException
public static XContentBuilder cborBuilder(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public static XContentBuilder contentBuilder(XContentType type, java.io.OutputStream outputStream) throws java.io.IOException
java.io.IOException
public static XContentBuilder contentBuilder(XContentType type) throws java.io.IOException
java.io.IOException
public static XContent xContent(XContentType type)
XContent
for the provided content type.public static XContentType xContentType(java.lang.CharSequence content)
public static XContent xContent(java.lang.CharSequence content)
public static XContent xContent(byte[] data)
public static XContent xContent(byte[] data, int offset, int length)
public static XContentType xContentType(byte[] data)
public static XContentType xContentType(java.io.InputStream si) throws java.io.IOException
java.io.IOException
public static XContentType xContentType(byte[] data, int offset, int length)
public static XContent xContent(BytesReference bytes)
public static XContentType xContentType(BytesReference bytes)