2 * Copyright (c) 2017 Pantheon Technologies, 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.yang.parser.rfc7950.stmt.meta;
10 import com.google.common.collect.ImmutableList;
11 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
12 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
13 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.stmt.OrganizationEffectiveStatement;
15 import org.opendaylight.yangtools.yang.model.api.stmt.OrganizationStatement;
16 import org.opendaylight.yangtools.yang.model.ri.stmt.DeclaredStatements;
17 import org.opendaylight.yangtools.yang.model.ri.stmt.EffectiveStatements;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractInternedStringStatementSupport;
19 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
21 public final class OrganizationStatementSupport
22 extends AbstractInternedStringStatementSupport<OrganizationStatement, OrganizationEffectiveStatement> {
23 private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(
24 YangStmtMapping.ORGANIZATION)
26 private static final OrganizationStatementSupport INSTANCE = new OrganizationStatementSupport();
28 private OrganizationStatementSupport() {
29 super(YangStmtMapping.ORGANIZATION, StatementPolicy.reject());
32 public static OrganizationStatementSupport getInstance() {
37 protected SubstatementValidator getSubstatementValidator() {
38 return SUBSTATEMENT_VALIDATOR;
42 protected OrganizationStatement createDeclared(final String argument,
43 final ImmutableList<? extends DeclaredStatement<?>> substatements) {
44 return DeclaredStatements.createOrganization(argument, substatements);
48 protected OrganizationStatement createEmptyDeclared(final String argument) {
49 return DeclaredStatements.createOrganization(argument);
53 protected OrganizationEffectiveStatement createEffective(final OrganizationStatement declared,
54 final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
55 return EffectiveStatements.createOrganization(declared, substatements);
59 protected OrganizationEffectiveStatement createEmptyEffective(final OrganizationStatement declared) {
60 return EffectiveStatements.createOrganization(declared);