Reduce exception guard
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / jersey / providers / AbstractNormalizedNodeBodyReader.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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.restconf.nb.rfc8040.jersey.providers;
9
10 import javax.ws.rs.core.Request;
11 import javax.ws.rs.core.UriInfo;
12 import org.opendaylight.mdsal.dom.api.DOMMountPointService;
13 import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
14 import org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler;
15 import org.opendaylight.restconf.nb.rfc8040.jersey.providers.spi.AbstractIdentifierAwareJaxRsProvider;
16 import org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload;
17
18 /**
19  * Common superclass for readers producing {@link NormalizedNodePayload}.
20  */
21 abstract class AbstractNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider<NormalizedNodePayload> {
22     AbstractNormalizedNodeBodyReader(final SchemaContextHandler schemaContextHandler,
23             final DOMMountPointService mountPointService) {
24         super(schemaContextHandler, mountPointService);
25     }
26
27     public final void injectParams(final UriInfo uriInfo, final Request request) {
28         setUriInfo(uriInfo);
29         setRequest(request);
30     }
31
32     @Override
33     protected final NormalizedNodePayload emptyBody(final InstanceIdentifierContext path) {
34         return NormalizedNodePayload.empty(path);
35     }
36 }