Class MapXContentParser

java.lang.Object
org.elasticsearch.common.xcontent.support.AbstractXContentParser
org.elasticsearch.common.xcontent.support.MapXContentParser
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable, XContentParser

public class MapXContentParser
extends AbstractXContentParser
Wraps a map generated by XContentParser's map() method into XContent Parser
  • Constructor Details

  • Method Details

    • wrapObject

      public static XContentParser wrapObject​(java.lang.Object sourceMap) throws java.io.IOException
      Throws:
      java.io.IOException
    • doBooleanValue

      protected boolean doBooleanValue() throws java.io.IOException
      Specified by:
      doBooleanValue in class AbstractXContentParser
      Throws:
      java.io.IOException
    • doShortValue

      protected short doShortValue() throws java.io.IOException
      Specified by:
      doShortValue in class AbstractXContentParser
      Throws:
      java.io.IOException
    • doIntValue

      protected int doIntValue() throws java.io.IOException
      Specified by:
      doIntValue in class AbstractXContentParser
      Throws:
      java.io.IOException
    • doLongValue

      protected long doLongValue() throws java.io.IOException
      Specified by:
      doLongValue in class AbstractXContentParser
      Throws:
      java.io.IOException
    • doFloatValue

      protected float doFloatValue() throws java.io.IOException
      Specified by:
      doFloatValue in class AbstractXContentParser
      Throws:
      java.io.IOException
    • doDoubleValue

      protected double doDoubleValue() throws java.io.IOException
      Specified by:
      doDoubleValue in class AbstractXContentParser
      Throws:
      java.io.IOException
    • contentType

      public XContentType contentType()
    • nextToken

      public XContentParser.Token nextToken() throws java.io.IOException
      Throws:
      java.io.IOException
    • skipChildren

      public void skipChildren() throws java.io.IOException
      Throws:
      java.io.IOException
    • currentToken

      public XContentParser.Token currentToken()
    • currentName

      public java.lang.String currentName() throws java.io.IOException
      Throws:
      java.io.IOException
    • text

      public java.lang.String text() throws java.io.IOException
      Throws:
      java.io.IOException
    • charBuffer

      public java.nio.CharBuffer charBuffer() throws java.io.IOException
      Description copied from interface: XContentParser
      Returns a CharBuffer holding UTF-8 bytes. This method should be used to read text only binary content should be read through XContentParser.binaryValue()
      Throws:
      java.io.IOException
    • objectText

      public java.lang.Object objectText() throws java.io.IOException
      Throws:
      java.io.IOException
    • objectBytes

      public java.lang.Object objectBytes() throws java.io.IOException
      Throws:
      java.io.IOException
    • hasTextCharacters

      public boolean hasTextCharacters()
      Description copied from interface: XContentParser
      Method that can be used to determine whether calling of textCharacters() would be the most efficient way to access textual content for the event parser currently points to. Default implementation simply returns false since only actual implementation class has knowledge of its internal buffering state. This method shouldn't be used to check if the token contains text or not.
    • textCharacters

      public char[] textCharacters() throws java.io.IOException
      Throws:
      java.io.IOException
    • textLength

      public int textLength() throws java.io.IOException
      Throws:
      java.io.IOException
    • textOffset

      public int textOffset() throws java.io.IOException
      Throws:
      java.io.IOException
    • numberValue

      public java.lang.Number numberValue() throws java.io.IOException
      Throws:
      java.io.IOException
    • numberType

      public XContentParser.NumberType numberType() throws java.io.IOException
      Throws:
      java.io.IOException
    • binaryValue

      public byte[] binaryValue() throws java.io.IOException
      Description copied from interface: XContentParser
      Reads a plain binary value that was written via one of the following methods: as well as via their String variants of the separated value methods. Note: Do not use this method to read values written with: these methods write UTF-8 encoded strings and must be read through:
      Throws:
      java.io.IOException
    • getTokenLocation

      public XContentLocation getTokenLocation()
      Description copied from interface: XContentParser
      Used for error reporting to highlight where syntax errors occur in content being parsed.
      Returns:
      last token's location or null if cannot be determined
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface XContentParser
      Specified by:
      isClosed in class AbstractXContentParser
    • close

      public void close() throws java.io.IOException
      Throws:
      java.io.IOException