2 * Copyright (c) 2017 Cisco Systems, Inc. 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.yang.parser.rfc7950.stmt.type;
10 import com.google.common.annotations.Beta;
11 import com.google.common.collect.ImmutableMap;
12 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport;
15 * Class providing necessary support for processing YANG 1.1 Type statement.
18 public final class TypeStatementRFC7950Support extends AbstractTypeStatementSupport {
19 private static final ImmutableMap<String, StatementSupport<?, ?, ?>> ARGUMENT_SPECIFIC_SUPPORTS = ImmutableMap.of(
20 LEAF_REF, new LeafrefSpecificationRFC7950Support(),
21 IDENTITY_REF, new IdentityrefSpecificationRFC7950Support());
22 private static final TypeStatementRFC7950Support INSTANCE = new TypeStatementRFC7950Support();
24 private TypeStatementRFC7950Support() {
28 public static TypeStatementRFC7950Support getInstance() {
33 public boolean hasArgumentSpecificSupports() {
34 return !ARGUMENT_SPECIFIC_SUPPORTS.isEmpty() || super.hasArgumentSpecificSupports();
38 public StatementSupport<?, ?, ?> getSupportSpecificForArgument(final String argument) {
39 final StatementSupport<?, ?, ?> potential = ARGUMENT_SPECIFIC_SUPPORTS.get(argument);
40 return potential != null ? potential : super.getSupportSpecificForArgument(argument);