8a44a8629d0d3e0f90294eecb07b18f0d3736814
[yangtools.git] / yang / yang-data-codec-gson / src / main / java / org / opendaylight / yangtools / yang / data / codec / gson / SimpleJSONCodecFactory.java
1 /*
2  * Copyright (c) 2017 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.yang.data.codec.gson;
9
10 import javax.annotation.concurrent.ThreadSafe;
11 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
12 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
13 import org.opendaylight.yangtools.yang.model.api.TypedSchemaNode;
14
15 /**
16  * A simplistic factory, which does not perform any codec caching. Minimizes resident memory footprint at the expense
17  * of creating short-lived objects.
18  *
19  * @author Robert Varga
20  */
21 @ThreadSafe
22 final class SimpleJSONCodecFactory extends JSONCodecFactory {
23     SimpleJSONCodecFactory(final SchemaContext context) {
24         super(context);
25     }
26
27     @Override
28     JSONCodec<?> lookupComplex(final TypedSchemaNode schema) {
29         return null;
30     }
31
32     @Override
33     JSONCodec<?> lookupSimple(final TypeDefinition<?> type) {
34         return null;
35     }
36
37     @Override
38     JSONCodec<?> getSimple(final TypeDefinition<?> type, final JSONCodec<?> codec) {
39         return codec;
40     }
41
42     @Override
43     JSONCodec<?> getComplex(final TypedSchemaNode schema, final JSONCodec<?> codec) {
44         return codec;
45     }
46 }