Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ public int hashCode() {
@Override
public String toString() {
StringWriter sw = new StringWriter();
try (JsonWriter jw = new JsonWriterImpl(sw, bufferPool)) {
try (JsonWriter jw = new JsonWriterImpl(sw, bufferPool, Collections.emptyMap())) {
jw.write(this);
}
return sw.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
package org.eclipse.parsson;

import java.util.Collection;
import java.util.Map;

import org.eclipse.parsson.api.BufferPool;

import jakarta.json.JsonObject;
import jakarta.json.JsonArray;
import jakarta.json.JsonArrayBuilder;
import jakarta.json.JsonBuilderFactory;
import jakarta.json.JsonObject;
import jakarta.json.JsonObjectBuilder;
import java.util.Collections;
import java.util.Map;

/**
* @author Jitendra Kotamraju
Expand All @@ -35,25 +35,25 @@ class JsonBuilderFactoryImpl implements JsonBuilderFactory {
private final BufferPool bufferPool;
private final boolean rejectDuplicateKeys;

JsonBuilderFactoryImpl(BufferPool bufferPool, boolean rejectDuplicateKeys) {
this.config = Collections.emptyMap();
JsonBuilderFactoryImpl(BufferPool bufferPool, boolean rejectDuplicateKeys, Map<String, ?> config) {
this.config = config;
this.bufferPool = bufferPool;
this.rejectDuplicateKeys = rejectDuplicateKeys;
}

@Override
public JsonObjectBuilder createObjectBuilder() {
return new JsonObjectBuilderImpl(bufferPool, rejectDuplicateKeys);
return new JsonObjectBuilderImpl(bufferPool, rejectDuplicateKeys, config);
}

@Override
public JsonObjectBuilder createObjectBuilder(JsonObject object) {
return new JsonObjectBuilderImpl(object, bufferPool, rejectDuplicateKeys);
return new JsonObjectBuilderImpl(object, bufferPool, rejectDuplicateKeys, config);
}

@Override
public JsonObjectBuilder createObjectBuilder(Map<String, Object> object) {
return new JsonObjectBuilderImpl(object, bufferPool, rejectDuplicateKeys);
return new JsonObjectBuilderImpl(object, bufferPool, rejectDuplicateKeys, config);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,22 @@ class JsonGeneratorFactoryImpl implements JsonGeneratorFactory {
@Override
public JsonGenerator createGenerator(Writer writer) {
return prettyPrinting
? new JsonPrettyGeneratorImpl(writer, bufferPool)
: new JsonGeneratorImpl(writer, bufferPool);
? new JsonPrettyGeneratorImpl(writer, bufferPool, config)
: new JsonGeneratorImpl(writer, bufferPool, config);
}

@Override
public JsonGenerator createGenerator(OutputStream out) {
return prettyPrinting
? new JsonPrettyGeneratorImpl(out, bufferPool)
: new JsonGeneratorImpl(out, bufferPool);
? new JsonPrettyGeneratorImpl(out, bufferPool, config)
: new JsonGeneratorImpl(out, bufferPool, config);
}

@Override
public JsonGenerator createGenerator(OutputStream out, Charset charset) {
return prettyPrinting
? new JsonPrettyGeneratorImpl(out, charset, bufferPool)
: new JsonGeneratorImpl(out, charset, bufferPool);
? new JsonPrettyGeneratorImpl(out, charset, bufferPool, config)
: new JsonGeneratorImpl(out, charset, bufferPool, config);
}

@Override
Expand Down
Loading