Class JsonParserStream
- java.lang.Object
-
- org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static @NonNull JsonParserStream
create(@NonNull NormalizedNodeStreamWriter writer, @NonNull JSONCodecFactory codecFactory)
static @NonNull JsonParserStream
create(@NonNull NormalizedNodeStreamWriter writer, @NonNull JSONCodecFactory codecFactory, @NonNull EffectiveStatementInference parentNode)
static @NonNull JsonParserStream
createLenient(@NonNull NormalizedNodeStreamWriter writer, @NonNull JSONCodecFactory codecFactory)
static @NonNull JsonParserStream
createLenient(@NonNull NormalizedNodeStreamWriter writer, @NonNull JSONCodecFactory codecFactory, @NonNull EffectiveStatementInference parentNode)
void
flush()
JsonParserStream
parse(com.google.gson.stream.JsonReader reader)
void
read(com.google.gson.stream.JsonReader in, AbstractNodeDataWithSchema<?> parent)
-
-
-
Method Detail
-
create
public static @NonNull JsonParserStream create(@NonNull NormalizedNodeStreamWriter writer, @NonNull JSONCodecFactory codecFactory)
Create a newJsonParserStream
backed by specifiedNormalizedNodeStreamWriter
andJSONCodecFactory
. The stream will be logically rooted at the top of the SchemaContext associated with the specified codec factory.- Parameters:
writer
- NormalizedNodeStreamWriter to use for instantiation of normalized nodescodecFactory
-JSONCodecFactory
to use for parsing leaves- Returns:
- A new
JsonParserStream
- Throws:
NullPointerException
- if any of the arguments are null
-
create
public static @NonNull JsonParserStream create(@NonNull NormalizedNodeStreamWriter writer, @NonNull JSONCodecFactory codecFactory, @NonNull EffectiveStatementInference parentNode)
Create a newJsonParserStream
backed by specifiedNormalizedNodeStreamWriter
andJSONCodecFactory
. The stream will be logically rooted at the specified parent node.- Parameters:
writer
- NormalizedNodeStreamWriter to use for instantiation of normalized nodescodecFactory
-JSONCodecFactory
to use for parsing leavesparentNode
- Logical root node- Returns:
- A new
JsonParserStream
- Throws:
NullPointerException
- if any of the arguments are null
-
createLenient
public static @NonNull JsonParserStream createLenient(@NonNull NormalizedNodeStreamWriter writer, @NonNull JSONCodecFactory codecFactory)
Create a newJsonParserStream
backed by specifiedNormalizedNodeStreamWriter
andJSONCodecFactory
. The stream will be logically rooted at the top of the SchemaContext associated with the specified codec factory.Returned parser will treat incoming JSON data leniently:
- JSON elements referring to unknown constructs will be silently ignored
- Parameters:
writer
- NormalizedNodeStreamWriter to use for instantiation of normalized nodescodecFactory
-JSONCodecFactory
to use for parsing leaves- Returns:
- A new
JsonParserStream
- Throws:
NullPointerException
- if any of the arguments are null
-
createLenient
public static @NonNull JsonParserStream createLenient(@NonNull NormalizedNodeStreamWriter writer, @NonNull JSONCodecFactory codecFactory, @NonNull EffectiveStatementInference parentNode)
Create a newJsonParserStream
backed by specifiedNormalizedNodeStreamWriter
andJSONCodecFactory
. The stream will be logically rooted at the specified parent node.Returned parser will treat incoming JSON data leniently:
- JSON elements referring to unknown constructs will be silently ignored
- Parameters:
writer
- NormalizedNodeStreamWriter to use for instantiation of normalized nodescodecFactory
-JSONCodecFactory
to use for parsing leavesparentNode
- Logical root node- Returns:
- A new
JsonParserStream
- Throws:
NullPointerException
- if any of the arguments are null
-
parse
public JsonParserStream parse(com.google.gson.stream.JsonReader reader)
-
read
public void read(com.google.gson.stream.JsonReader in, AbstractNodeDataWithSchema<?> parent) throws IOException
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-