From 9a9cc0b8e42b187724ad654872b2f15ecf88ee49 Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 16 May 2014 14:55:07 +0200 Subject: [PATCH] Add simple example to XContentParser how to obtain an instance of it --- .../org/elasticsearch/common/xcontent/XContentParser.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/elasticsearch/common/xcontent/XContentParser.java b/src/main/java/org/elasticsearch/common/xcontent/XContentParser.java index 497dbe7503f..f76b5a8e83b 100644 --- a/src/main/java/org/elasticsearch/common/xcontent/XContentParser.java +++ b/src/main/java/org/elasticsearch/common/xcontent/XContentParser.java @@ -26,7 +26,14 @@ import java.io.IOException; import java.util.Map; /** + * Interface for pull - parsing {@link XContent} see {@link XContentType} for supported types. * + * To obtain an instance of this class use the following pattern: + * + *
+ *     XContentType xContentType = XContentType.JSON;
+ *     XContentParser parser = xContentType.xContent().createParser("{\"key\" : \"value\"}");
+ * 
*/ public interface XContentParser extends Closeable {