2 * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.odlext.parser;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableList;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.opendaylight.yangtools.odlext.model.api.ContextReferenceEffectiveStatement;
14 import org.opendaylight.yangtools.odlext.model.api.ContextReferenceStatement;
15 import org.opendaylight.yangtools.odlext.model.api.OpenDaylightExtensionsStatements;
16 import org.opendaylight.yangtools.yang.common.QName;
17 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
18 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
19 import org.opendaylight.yangtools.yang.model.api.stmt.IdentityEffectiveStatement;
20 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
23 public final class ContextReferenceStatementSupport
24 extends AbstractIdentityAwareStatementSupport<ContextReferenceStatement, ContextReferenceEffectiveStatement> {
25 public static final @NonNull ContextReferenceStatementSupport INSTANCE = new ContextReferenceStatementSupport();
27 private ContextReferenceStatementSupport() {
28 super(OpenDaylightExtensionsStatements.CONTEXT_REFERENCE);
32 protected ContextReferenceStatement createDeclared(final StmtContext<QName, ContextReferenceStatement, ?> ctx,
33 final ImmutableList<? extends DeclaredStatement<?>> substatements) {
34 return new ContextReferenceStatementImpl(ctx.rawArgument(), ctx.getArgument(), substatements);
38 ContextReferenceEffectiveStatement createEffective(final ContextReferenceStatement declared,
39 final IdentityEffectiveStatement identity,
40 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
41 return new ContextReferenceEffectiveStatementImpl(declared, identity, substatements);