2 * Copyright (c) 2015 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.stmt.rfc6020;
10 import com.google.common.collect.ImmutableMap;
11 import com.google.common.collect.ImmutableMap.Builder;
12 import com.google.common.collect.ImmutableSet;
15 import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
16 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
18 public final class YangValidationBundles {
19 private YangValidationBundles() {
20 throw new UnsupportedOperationException("Utility class");
23 public static final Set<StatementDefinition> SUPPORTED_REFINE_SUBSTATEMENTS = ImmutableSet.of(
24 Rfc6020Mapping.DEFAULT, Rfc6020Mapping.DESCRIPTION, Rfc6020Mapping.REFERENCE, Rfc6020Mapping.CONFIG,
25 Rfc6020Mapping.MANDATORY, Rfc6020Mapping.MUST, Rfc6020Mapping.PRESENCE, Rfc6020Mapping.MIN_ELEMENTS,
26 Rfc6020Mapping.MAX_ELEMENTS);
28 public static final Map<StatementDefinition, Set<StatementDefinition>> SUPPORTED_REFINE_TARGETS;
30 final Builder<StatementDefinition, Set<StatementDefinition>> b = ImmutableMap.builder();
31 b.put(Rfc6020Mapping.DEFAULT, ImmutableSet.of(Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE));
32 b.put(Rfc6020Mapping.MANDATORY, ImmutableSet.of(
33 Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE, Rfc6020Mapping.ANYXML));
34 b.put(Rfc6020Mapping.PRESENCE, ImmutableSet.of(Rfc6020Mapping.CONTAINER));
35 b.put(Rfc6020Mapping.MUST, ImmutableSet.of(
36 Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF,
37 Rfc6020Mapping.LEAF_LIST, Rfc6020Mapping.ANYXML));
38 b.put(Rfc6020Mapping.MIN_ELEMENTS, ImmutableSet.of(
39 Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF_LIST));
40 b.put(Rfc6020Mapping.MAX_ELEMENTS, ImmutableSet.of(
41 Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF_LIST));
42 SUPPORTED_REFINE_TARGETS = b.build();
46 public static final Set<StatementDefinition> SUPPORTED_AUGMENT_TARGETS = ImmutableSet.of(
47 Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.CASE, Rfc6020Mapping.INPUT, Rfc6020Mapping.OUTPUT,
48 Rfc6020Mapping.NOTIFICATION, Rfc6020Mapping.CHOICE, Rfc6020Mapping.RPC);
50 public static final Set<StatementDefinition> SUPPORTED_CASE_SHORTHANDS = ImmutableSet.of(
51 Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF, Rfc6020Mapping.LEAF_LIST,
52 Rfc6020Mapping.ANYXML);
54 public static final Set<StatementDefinition> SUPPORTED_DATA_NODES = ImmutableSet.of(
55 Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF, Rfc6020Mapping.LEAF_LIST,
56 Rfc6020Mapping.ANYXML);