Package org.elasticsearch.xcontent.json
Class JsonXContentParser
java.lang.Object
org.elasticsearch.xcontent.support.AbstractXContentParser
org.elasticsearch.xcontent.json.JsonXContentParser
- All Implemented Interfaces:
Closeable
,AutoCloseable
,XContentParser
- Direct Known Subclasses:
CborXContentParser
,SmileXContentParser
,YamlXContentParser
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.XContentParser
XContentParser.NumberType, XContentParser.Token
-
Field Summary
Fields inherited from class org.elasticsearch.xcontent.support.AbstractXContentParser
DEFAULT_NUMBER_COERCE_POLICY
-
Constructor Summary
ConstructorDescriptionJsonXContentParser
(NamedXContentRegistry xContentRegistry, DeprecationHandler deprecationHandler, com.fasterxml.jackson.core.JsonParser parser) JsonXContentParser
(NamedXContentRegistry xContentRegistry, DeprecationHandler deprecationHandler, com.fasterxml.jackson.core.JsonParser parser, FilterPath[] include, FilterPath[] exclude) -
Method Summary
Modifier and TypeMethodDescriptionvoid
allowDuplicateKeys
(boolean allowDuplicateKeys) byte[]
Reads a plain binary value that was written via one of the following methods:XContentBuilder.field(String, byte[], int, int)
}XContentBuilder.field(String, byte[])
} as well as via theirString
variants of the separated value methods.Returns aCharBuffer
holding UTF-8 bytes.void
close()
protected boolean
double
float
int
long
short
Used for error reporting to highlight where syntax errors occur in content being parsed.boolean
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.boolean
isClosed()
void
text()
char[]
int
int
Methods inherited from class org.elasticsearch.xcontent.support.AbstractXContentParser
booleanValue, charBufferOrNull, doubleValue, doubleValue, floatValue, floatValue, getDeprecationHandler, getXContentRegistry, intValue, intValue, isBooleanValue, list, listOrderedMap, longValue, longValue, map, map, mapOrdered, mapStrings, namedObject, readValue, shortValue, shortValue, textOrNull
-
Constructor Details
-
JsonXContentParser
public JsonXContentParser(NamedXContentRegistry xContentRegistry, DeprecationHandler deprecationHandler, com.fasterxml.jackson.core.JsonParser parser) -
JsonXContentParser
public JsonXContentParser(NamedXContentRegistry xContentRegistry, DeprecationHandler deprecationHandler, com.fasterxml.jackson.core.JsonParser parser, FilterPath[] include, FilterPath[] exclude)
-
-
Method Details
-
contentType
-
allowDuplicateKeys
public void allowDuplicateKeys(boolean allowDuplicateKeys) -
nextToken
- Throws:
IOException
-
skipChildren
- Throws:
IOException
-
currentToken
-
numberType
- Throws:
IOException
-
currentName
- Throws:
IOException
-
doBooleanValue
- Specified by:
doBooleanValue
in classAbstractXContentParser
- Throws:
IOException
-
text
- Throws:
IOException
-
charBuffer
Description copied from interface:XContentParser
Returns aCharBuffer
holding UTF-8 bytes. This method should be used to read text only binary content should be read throughXContentParser.binaryValue()
- Throws:
IOException
-
objectText
- Throws:
IOException
-
objectBytes
- Throws:
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
- Throws:
IOException
-
textLength
- Throws:
IOException
-
textOffset
- Throws:
IOException
-
numberValue
- Throws:
IOException
-
doShortValue
- Specified by:
doShortValue
in classAbstractXContentParser
- Throws:
IOException
-
doIntValue
- Specified by:
doIntValue
in classAbstractXContentParser
- Throws:
IOException
-
doLongValue
- Specified by:
doLongValue
in classAbstractXContentParser
- Throws:
IOException
-
doFloatValue
- Specified by:
doFloatValue
in classAbstractXContentParser
- Throws:
IOException
-
doDoubleValue
- Specified by:
doDoubleValue
in classAbstractXContentParser
- Throws:
IOException
-
binaryValue
Description copied from interface:XContentParser
Reads a plain binary value that was written via one of the following methods: as well as via theirString
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:
IOException
-
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
-
close
public void close() -
isClosed
public boolean isClosed()- Specified by:
isClosed
in interfaceXContentParser
- Specified by:
isClosed
in classAbstractXContentParser
-