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.namespace;
11 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
12 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
13 import org.opendaylight.yangtools.yang.model.api.stmt.NamespaceStatement;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
18 public final class NamespaceStatementSupport extends AbstractStatementSupport<URI, NamespaceStatement,
19 EffectiveStatement<URI, NamespaceStatement>> {
20 private static final SubstatementValidator SUBSTATEMENT_VALIDATOR = SubstatementValidator.builder(YangStmtMapping
23 private static final NamespaceStatementSupport INSTANCE = new NamespaceStatementSupport();
25 private NamespaceStatementSupport() {
26 super(YangStmtMapping.NAMESPACE);
29 public static NamespaceStatementSupport getInstance() {
34 public URI parseArgumentValue(final StmtContext<?, ?,?> ctx, final String value) {
35 return URI.create(value);
39 public NamespaceStatement createDeclared(final StmtContext<URI, NamespaceStatement,?> ctx) {
40 return new NamespaceStatementImpl(ctx);
44 public EffectiveStatement<URI,NamespaceStatement> createEffective(
45 final StmtContext<URI, NamespaceStatement, EffectiveStatement<URI, NamespaceStatement>> ctx) {
46 return new NamespaceEffectiveStatementImpl(ctx);
50 protected SubstatementValidator getSubstatementValidator() {
51 return SUBSTATEMENT_VALIDATOR;