1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.johnzon.core; |
20 | |
|
21 | |
import static java.util.Arrays.asList; |
22 | |
|
23 | |
import java.io.InputStream; |
24 | |
import java.io.Reader; |
25 | |
import java.nio.charset.Charset; |
26 | |
import java.util.Collection; |
27 | |
import java.util.Collections; |
28 | |
import java.util.Map; |
29 | |
|
30 | |
import javax.json.JsonReader; |
31 | |
import javax.json.JsonReaderFactory; |
32 | |
|
33 | |
class JsonReaderFactoryImpl extends AbstractJsonFactory implements JsonReaderFactory { |
34 | 1 | static final Collection<String> SUPPORTED_CONFIG_KEYS = asList( |
35 | |
|
36 | |
); |
37 | |
private final JsonParserFactoryImpl parserFactory; |
38 | |
|
39 | |
JsonReaderFactoryImpl(final Map<String, ?> config) { |
40 | 46 | super(config, SUPPORTED_CONFIG_KEYS, JsonParserFactoryImpl.SUPPORTED_CONFIG_KEYS); |
41 | 46 | this.parserFactory = new JsonParserFactoryImpl(internalConfig); |
42 | 45 | } |
43 | |
|
44 | |
@Override |
45 | |
public JsonReader createReader(final Reader reader) { |
46 | 7 | return new JsonReaderImpl(parserFactory.createInternalParser(reader)); |
47 | |
} |
48 | |
|
49 | |
@Override |
50 | |
public JsonReader createReader(final InputStream in) { |
51 | 85 | return new JsonReaderImpl(parserFactory.createInternalParser(in)); |
52 | |
} |
53 | |
|
54 | |
@Override |
55 | |
public JsonReader createReader(final InputStream in, final Charset charset) { |
56 | 54 | return new JsonReaderImpl(parserFactory.createInternalParser(in, charset)); |
57 | |
} |
58 | |
|
59 | |
@Override |
60 | |
public Map<String, ?> getConfigInUse() { |
61 | 0 | return Collections.unmodifiableMap(internalConfig); |
62 | |
} |
63 | |
} |