Class XContentFactory

    • Constructor Detail

      • XContentFactory

        public XContentFactory()
    • Method Detail

      • xContentType

        @Deprecated
        public static XContentType xContentType​(CharSequence content)
        Deprecated.
        the content type should not be guessed except for few cases where we effectively don't know the content type. The REST layer should move to reading the Content-Type header instead. There are other places where auto-detection may be needed. This method is deprecated to prevent usages of it from spreading further without specific reasons.
        Guesses the content type based on the provided char sequence.
      • xContent

        @Deprecated
        public static XContent xContent​(CharSequence content)
        Deprecated.
        the content type should not be guessed except for few cases where we effectively don't know the content type. The REST layer should move to reading the Content-Type header instead. There are other places where auto-detection may be needed. This method is deprecated to prevent usages of it from spreading further without specific reasons.
        Guesses the content (type) based on the provided char sequence and returns the corresponding XContent
      • xContent

        @Deprecated
        public static XContent xContent​(byte[] data)
        Deprecated.
        the content type should not be guessed except for few cases where we effectively don't know the content type. The REST layer should move to reading the Content-Type header instead. There are other places where auto-detection may be needed. This method is deprecated to prevent usages of it from spreading further without specific reasons.
        Guesses the content type based on the provided bytes and returns the corresponding XContent
      • xContent

        @Deprecated
        public static XContent xContent​(byte[] data,
                                        int offset,
                                        int length)
        Deprecated.
        guessing the content type should not be needed ideally. We should rather know the content type upfront or read it from headers. Till we fixed the REST layer to read the Content-Type header, that should be the only place where guessing is needed.
        Guesses the content type based on the provided bytes and returns the corresponding XContent
      • xContentType

        @Deprecated
        public static XContentType xContentType​(InputStream si)
                                         throws IOException
        Deprecated.
        the content type should not be guessed except for few cases where we effectively don't know the content type. The REST layer should move to reading the Content-Type header instead. There are other places where auto-detection may be needed. This method is deprecated to prevent usages of it from spreading further without specific reasons.
        Guesses the content type based on the provided input stream without consuming it.
        Throws:
        IOException
      • xContentType

        @Deprecated
        public static XContentType xContentType​(byte[] bytes)
        Deprecated.
        the content type should not be guessed except for few cases where we effectively don't know the content type. The REST layer should move to reading the Content-Type header instead. There are other places where auto-detection may be needed. This method is deprecated to prevent usages of it from spreading further without specific reasons.
        Guesses the content type based on the provided bytes.
      • xContentType

        @Deprecated
        public static XContentType xContentType​(byte[] bytes,
                                                int offset,
                                                int length)
        Deprecated.
        the content type should not be guessed except for few cases where we effectively don't know the content type. The REST layer should move to reading the Content-Type header instead. There are other places where auto-detection may be needed. This method is deprecated to prevent usages of it from spreading further without specific reasons.
        Guesses the content type based on the provided bytes.