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;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport;
16 * Class providing necessary support for processing YANG 1.1 Type statement.
19 public final class TypeStatementRFC7950Support extends AbstractTypeStatementSupport {
20 private static final Map<String, StatementSupport<?, ?, ?>> ARGUMENT_SPECIFIC_SUPPORTS = ImmutableMap.of(
21 LEAF_REF, new LeafrefSpecificationRFC7950Support(),
22 IDENTITY_REF, new IdentityrefSpecificationRFC7950Support());
25 public boolean hasArgumentSpecificSupports() {
26 return !ARGUMENT_SPECIFIC_SUPPORTS.isEmpty() || super.hasArgumentSpecificSupports();
30 public StatementSupport<?, ?, ?> getSupportSpecificForArgument(final String argument) {
31 final StatementSupport<?, ?, ?> potential = ARGUMENT_SPECIFIC_SUPPORTS.get(argument);
32 return potential != null ? potential : super.getSupportSpecificForArgument(argument);