Merge branch 'master' of ../controller
[yangtools.git] / yang / yang-parser-spi / src / main / java / org / opendaylight / yangtools / yang / parser / spi / source / QNameToStatementDefinition.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.parser.spi.source;
9
10 import java.net.URI;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
15 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
16 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
17
18 /**
19  * Map of fully qualified statement name to statement definition.
20  */
21 public interface QNameToStatementDefinition extends IdentifierNamespace<QName, StatementDefinition> {
22     NamespaceBehaviour<QName, StatementDefinition, @NonNull QNameToStatementDefinition> BEHAVIOUR =
23             NamespaceBehaviour.sourceLocal(QNameToStatementDefinition.class);
24
25     /**
26      * Returns StatementDefinition with specified QName.
27      *
28      * @param identifier
29      *            QName of requested statement
30      * @return StatementDefinition
31      */
32     @Override
33     StatementDefinition get(QName identifier);
34
35     /**
36      * Returns StatementDefinition with specified namespace and localName.
37      *
38      * @param namespace
39      *            namespace of requested statement
40      * @param localName
41      *            localName of requested statement
42      * @return StatementDefinition
43      */
44     @Nullable StatementDefinition getByNamespaceAndLocalName(@NonNull URI namespace, @NonNull String localName);
45 }