blob: 897552db0a7f6cb70c072909b20ce01e8d67aa21 [file] [log] [blame]
Vinod Kumar S17711e52016-02-09 20:02:43 +05301/*
2 * Copyright 2016 Open Networking Laboratory
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.yangutils.datamodel;
18
19import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
20import org.onosproject.yangutils.parser.Parsable;
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053021import org.onosproject.yangutils.utils.YangConstructType;
Vinod Kumar S17711e52016-02-09 20:02:43 +053022
23/*
24 * Reference:RFC 6020.
25 * The "namespace" statement defines the XML namespace that all
26 * identifiers defined by the module are qualified by, with the
27 * exception of data node identifiers defined inside a grouping.
28 * The argument to the "namespace" statement is the URI of the
29 * namespace.
30 */
31
32/**
33 * Name space to be used for the XML data tree.
34 */
35public class YangNameSpace implements Parsable {
36
37 private String uri;
38
39 /**
40 * Default constructor.
41 */
42 public YangNameSpace() {
43 }
44
45 /**
46 * Get the name space URI.
47 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053048 * @return the URI
Vinod Kumar S17711e52016-02-09 20:02:43 +053049 */
50 public String getUri() {
51 return uri;
52 }
53
54 /**
55 * Set the name space URI.
56 *
57 * @param uri the URI to set
58 */
59 public void setUri(String uri) {
60 this.uri = uri;
61 }
62
63 /**
64 * Returns the type of the parsed data.
65 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053066 * @return returns NAMESPACE_DATA
Vinod Kumar S17711e52016-02-09 20:02:43 +053067 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053068 @Override
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053069 public YangConstructType getYangConstructType() {
70 return YangConstructType.NAMESPACE_DATA;
Vinod Kumar S17711e52016-02-09 20:02:43 +053071 }
72
73 /**
74 * Validate the data on entering the corresponding parse tree node.
75 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053076 * @throws DataModelException a violation of data model rules
Vinod Kumar S17711e52016-02-09 20:02:43 +053077 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053078 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +053079 public void validateDataOnEntry() throws DataModelException {
80 // TODO auto-generated method stub, to be implemented by parser
81
82 }
83
84 /**
85 * Validate the data on exiting the corresponding parse tree node.
86 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053087 * @throws DataModelException a violation of data model rules
Vinod Kumar S17711e52016-02-09 20:02:43 +053088 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053089 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +053090 public void validateDataOnExit() throws DataModelException {
91 // TODO auto-generated method stub, to be implemented by parser
92
93 }
94}