Coverage Report - org.apache.johnzon.core.JsonReaderFactoryImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
JsonReaderFactoryImpl
87%
7/8
N/A
1
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements. See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership. The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License. You may obtain a copy of the License at
 9  
  *
 10  
  * http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied. See the License for the
 16  
  * specific language governing permissions and limitations
 17  
  * under the License.
 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  
 }