Vinod Kumar S | 5a39e01 | 2016-02-16 01:37:16 +0530 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package org.onosproject.yangutils.datamodel; |
| 18 | |
| 19 | import java.util.HashSet; |
| 20 | import java.util.Set; |
| 21 | |
| 22 | import org.onosproject.yangutils.datamodel.exceptions.DataModelException; |
| 23 | import org.onosproject.yangutils.parser.Parsable; |
| 24 | import org.onosproject.yangutils.parser.ParsableDataType; |
| 25 | |
| 26 | /* |
| 27 | * The enumeration built-in type represents values from a set of |
| 28 | * assigned names. |
| 29 | */ |
| 30 | |
| 31 | /** |
| 32 | * Maintains the enumeration data type information. |
| 33 | */ |
| 34 | public class YangEnumeration extends YangNode implements Parsable { |
| 35 | |
| 36 | /** |
| 37 | * Enumeration info set. |
| 38 | */ |
| 39 | private Set<YangEnum> enumSet; |
| 40 | |
| 41 | /** |
| 42 | * Create an enumeration object. |
| 43 | */ |
| 44 | public YangEnumeration() { |
| 45 | super(YangNodeType.ENUMERATION_NODE); |
| 46 | setEnumSet(new HashSet<YangEnum>()); |
| 47 | |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Get the ENUM set. |
| 52 | * |
| 53 | * @return the ENUM set |
| 54 | */ |
| 55 | public Set<YangEnum> getEnumSet() { |
| 56 | return enumSet; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Set the ENUM set. |
| 61 | * |
| 62 | * @param enumSet the ENUM set to set |
| 63 | */ |
| 64 | private void setEnumSet(Set<YangEnum> enumSet) { |
| 65 | this.enumSet = enumSet; |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * Add ENUM value. |
| 70 | * |
| 71 | * @param enumInfo the ENUM value of string |
| 72 | */ |
| 73 | public void addEnumInfo(YangEnum enumInfo) { |
| 74 | |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * Returns the type of the data. |
| 79 | * |
| 80 | * @return returns ENUMERATION_DATA |
| 81 | */ |
| 82 | public ParsableDataType getParsableDataType() { |
| 83 | return ParsableDataType.ENUMERATION_DATA; |
| 84 | } |
| 85 | |
| 86 | /** |
| 87 | * Validate the data on entering the corresponding parse tree node. |
| 88 | * |
| 89 | * @throws DataModelException a violation of data model rules. |
| 90 | */ |
| 91 | public void validateDataOnEntry() throws DataModelException { |
| 92 | // TODO auto-generated method stub, to be implemented by parser |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Validate the data on exiting the corresponding parse tree node. |
| 97 | * |
| 98 | * @throws DataModelException a violation of data model rules. |
| 99 | */ |
| 100 | public void validateDataOnExit() throws DataModelException { |
| 101 | // TODO auto-generated method stub, to be implemented by parser |
| 102 | } |
| 103 | |
| 104 | /* (non-Javadoc) |
| 105 | * @see org.onosproject.yangutils.datamodel.YangNode#getName() |
| 106 | */ |
| 107 | @Override |
| 108 | public String getName() { |
| 109 | // TODO Auto-generated method stub |
| 110 | return null; |
| 111 | } |
| 112 | |
| 113 | /* (non-Javadoc) |
| 114 | * @see org.onosproject.yangutils.datamodel.YangNode#setName(java.lang.String) |
| 115 | */ |
| 116 | @Override |
| 117 | public void setName(String name) { |
| 118 | // TODO Auto-generated method stub |
| 119 | |
| 120 | } |
| 121 | |
| 122 | /* (non-Javadoc) |
| 123 | * @see org.onosproject.yangutils.datamodel.YangNode#getPackage() |
| 124 | */ |
| 125 | @Override |
| 126 | public String getPackage() { |
| 127 | // TODO Auto-generated method stub |
| 128 | return null; |
| 129 | } |
| 130 | |
| 131 | /* (non-Javadoc) |
| 132 | * @see org.onosproject.yangutils.datamodel.YangNode#setPackage(java.lang.String) |
| 133 | */ |
| 134 | @Override |
| 135 | public void setPackage(String pkg) { |
| 136 | // TODO Auto-generated method stub |
| 137 | |
| 138 | } |
| 139 | |
| 140 | /* (non-Javadoc) |
| 141 | * @see org.onosproject.yangutils.translator.CodeGenerator#generateJavaCodeEntry() |
| 142 | */ |
| 143 | public void generateJavaCodeEntry() { |
| 144 | // TODO Auto-generated method stub |
| 145 | |
| 146 | } |
| 147 | |
| 148 | /* (non-Javadoc) |
| 149 | * @see org.onosproject.yangutils.translator.CodeGenerator#generateJavaCodeExit() |
| 150 | */ |
| 151 | public void generateJavaCodeExit() { |
| 152 | // TODO Auto-generated method stub |
| 153 | |
| 154 | } |
| 155 | } |