blob: 60f327f57792c1201205b14bfa46b1fecec583c6 [file] [log] [blame]
Vinod Kumar S17711e52016-02-09 20:02:43 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Vinod Kumar S17711e52016-02-09 20:02:43 +05303 *
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
Bharat saraswal96dfef02016-06-16 00:29:12 +053019import java.io.Serializable;
20
Vinod Kumar S17711e52016-02-09 20:02:43 +053021import org.onosproject.yangutils.datamodel.exceptions.DataModelException;
Bharat saraswal96dfef02016-06-16 00:29:12 +053022import org.onosproject.yangutils.datamodel.utils.Parsable;
23import org.onosproject.yangutils.datamodel.utils.YangConstructType;
Vinod Kumar S17711e52016-02-09 20:02:43 +053024
25/*
26 * Reference:RFC 6020.
27 * The "namespace" statement defines the XML namespace that all
28 * identifiers defined by the module are qualified by, with the
29 * exception of data node identifiers defined inside a grouping.
30 * The argument to the "namespace" statement is the URI of the
31 * namespace.
32 */
33
34/**
Bharat saraswald9822e92016-04-05 15:13:44 +053035 * Represents name space to be used for the XML data tree.
Vinod Kumar S17711e52016-02-09 20:02:43 +053036 */
Bharat saraswal96dfef02016-06-16 00:29:12 +053037public class YangNameSpace implements Parsable, Serializable {
38
39 private static final long serialVersionUID = 806201647L;
Vinod Kumar S17711e52016-02-09 20:02:43 +053040
41 private String uri;
42
43 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053044 * Creats a YANG name space object.
Vinod Kumar S17711e52016-02-09 20:02:43 +053045 */
46 public YangNameSpace() {
47 }
48
49 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053050 * Returns the name space URI.
Vinod Kumar S17711e52016-02-09 20:02:43 +053051 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053052 * @return the URI
Vinod Kumar S17711e52016-02-09 20:02:43 +053053 */
54 public String getUri() {
55 return uri;
56 }
57
58 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053059 * Sets the name space URI.
Vinod Kumar S17711e52016-02-09 20:02:43 +053060 *
61 * @param uri the URI to set
62 */
63 public void setUri(String uri) {
64 this.uri = uri;
65 }
66
67 /**
68 * Returns the type of the parsed data.
69 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053070 * @return returns NAMESPACE_DATA
Vinod Kumar S17711e52016-02-09 20:02:43 +053071 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053072 @Override
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053073 public YangConstructType getYangConstructType() {
74 return YangConstructType.NAMESPACE_DATA;
Vinod Kumar S17711e52016-02-09 20:02:43 +053075 }
76
77 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053078 * Validates the data on entering the corresponding parse tree node.
Vinod Kumar S17711e52016-02-09 20:02:43 +053079 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053080 * @throws DataModelException a violation of data model rules
Vinod Kumar S17711e52016-02-09 20:02:43 +053081 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053082 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +053083 public void validateDataOnEntry() throws DataModelException {
84 // TODO auto-generated method stub, to be implemented by parser
Vinod Kumar S17711e52016-02-09 20:02:43 +053085 }
86
87 /**
Bharat saraswald9822e92016-04-05 15:13:44 +053088 * Validates the data on exiting the corresponding parse tree node.
Vinod Kumar S17711e52016-02-09 20:02:43 +053089 *
Gaurav Agrawal8e8770a2016-02-27 03:57:50 +053090 * @throws DataModelException a violation of data model rules
Vinod Kumar S17711e52016-02-09 20:02:43 +053091 */
Vinod Kumar S0c330cd2016-02-23 22:36:57 +053092 @Override
Vinod Kumar S17711e52016-02-09 20:02:43 +053093 public void validateDataOnExit() throws DataModelException {
94 // TODO auto-generated method stub, to be implemented by parser
Vinod Kumar S17711e52016-02-09 20:02:43 +053095 }
96}