org.elasticsearch.common.xcontent.smile.SmileXContent Java Examples

The following examples show how to use org.elasticsearch.common.xcontent.smile.SmileXContent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XContentFactory.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #2
Source File: XContentFactory.java    From crate with Apache License 2.0 5 votes vote down vote up
/**
 * 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();
    }
    throw new IllegalArgumentException("No matching content type for " + type);
}
 
Example #3
Source File: XContentFactory.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
/**
 * 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);
}
 
Example #4
Source File: XmlXContentFactory.java    From elasticsearch-xml with Apache License 2.0 4 votes vote down vote up
/**
 * 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);
}
 
Example #5
Source File: XContentFactory.java    From crate with Apache License 2.0 4 votes vote down vote up
/**
 * 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.SMILE_XCONTENT, os);
}