Add simple example to XContentParser how to obtain an instance of it

This commit is contained in:
Simon Willnauer 2014-05-16 14:55:07 +02:00
parent bd871f96c2
commit 9a9cc0b8e4
1 changed files with 7 additions and 0 deletions

View File

@ -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:
*
* <pre>
* XContentType xContentType = XContentType.JSON;
* XContentParser parser = xContentType.xContent().createParser("{\"key\" : \"value\"}");
* </pre>
*/
public interface XContentParser extends Closeable {