- /**
- * Create a new stream writer, which writes to the specified {@link Writer}.
- *
- * This instance of writer can be used only to emit one top level element,
- * therwise it will produce incorrect JSON.
- *
- * @param schemaContext Schema context
- * @param writer Output writer
- * @return A stream writer instance
- */
- public static NormalizedNodeStreamWriter create(final SchemaContext schemaContext, final Writer writer) {
- return create(schemaContext, SchemaPath.ROOT, null, writer);
- }
-
- /**
- * Create a new stream writer, which writes to the specified {@link Writer}.
- *
- * This instance of writer can be used only to emit one top level element,
- * therwise it will produce incorrect JSON.
- *
- * @param schemaContext Schema context
- * @param path Root schemapath
- * @param writer Output writer
- * @return A stream writer instance
- */
- public static NormalizedNodeStreamWriter create(final SchemaContext schemaContext, final SchemaPath path, final Writer writer) {
- return create(schemaContext, path, null, writer);
- }
-
- /**
- * Create a new stream writer, which writes to the specified {@link Writer}.
- *
- * This instance of writer can be used only to emit one top level element,
- * therwise it will produce incorrect JSON.
- *
- * @param schemaContext Schema context
- * @param path Root schemapath
- * @param writer Output writer
- * @param initialNs Initial namespace
- * @return A stream writer instance
- */
- public static NormalizedNodeStreamWriter create(final SchemaContext schemaContext, final SchemaPath path,
- final URI initialNs, final Writer writer) {
- return createExclusiveWriter(JSONCodecFactory.create(schemaContext), path, initialNs, JsonWriterFactory.createJsonWriter(writer));
- }
-
- /**
- * Create a new stream writer, which writes to the specified output stream.
- *
- * This instance of writer can be used only to emit one top level element,
- * therwise it will produce incorrect JSON.
- *
- * @param schemaContext Schema context
- * @param writer Output writer
- * @param indentSize indentation size
- * @return A stream writer instance
- */
- public static NormalizedNodeStreamWriter create(final SchemaContext schemaContext, final Writer writer, final int indentSize) {
- return createExclusiveWriter(JSONCodecFactory.create(schemaContext), SchemaPath.ROOT, null,JsonWriterFactory.createJsonWriter(writer, indentSize));
- }
-
- /**
- * Create a new stream writer, which writes to the specified output stream. The codec factory
- * can be reused between multiple writers.
- *
- * This instance of writer can be used only to emit one top level element,
- * therwise it will produce incorrect JSON.
- *
- * @param codecFactory JSON codec factory
- * @param writer Output writer
- * @param indentSize indentation size
- * @return A stream writer instance
- */
- public static NormalizedNodeStreamWriter create(final JSONCodecFactory codecFactory, final Writer writer, final int indentSize) {
- return createExclusiveWriter(codecFactory, SchemaPath.ROOT, null, JsonWriterFactory.createJsonWriter(writer,indentSize));
- }
-
- /**
- * Create a new stream writer, which writes to the specified output stream.
- *
- * This instance of writer can be used only to emit one top level element,
- * therwise it will produce incorrect JSON.
- *
- * @param schemaContext Schema context
- * @param path Schema Path
- * @param initialNs Initial namespace
- * @param jsonWriter JsonWriter
- * @return A stream writer instance
- */
- public static NormalizedNodeStreamWriter create(SchemaContext schemaContext, SchemaPath path, URI initialNs,
- JsonWriter jsonWriter) {
- return createExclusiveWriter(JSONCodecFactory.create(schemaContext), path, initialNs, jsonWriter);
- }
-