本文整理了Java中org.onosproject.yang.compiler.datamodel.YangEnumeration
类的一些代码示例,展示了YangEnumeration
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangEnumeration
类的具体详情如下:
包路径:org.onosproject.yang.compiler.datamodel.YangEnumeration
类名称:YangEnumeration
[英]Represents the enumeration data type information.
[中]表示枚举数据类型信息。
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
/**
* Adds ENUM information.
*
* @param enumInfo the ENUM information to be added
* @throws DataModelException due to violation in data model rules
*/
public void addEnumInfo(YangEnum enumInfo)
throws DataModelException {
if (!getEnumSet().add(enumInfo)) {
throw new DataModelException("YANG ENUM already exists " +
getName() + " in " +
getLineNumber() + " at " +
getCharPosition() +
" in " + getFileName() + "\"");
}
}
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
/**
* Creates an enumeration object.
*/
public YangEnumeration() {
super(YangNodeType.ENUMERATION_NODE, null);
setEnumSet(new TreeSet<>());
}
代码示例来源:origin: org.onosproject/onos-yang-compiler-parser
enumerationNode.setLineNumber(ctx.getStart().getLine());
enumerationNode.setCharPosition(ctx.getStart().getCharPositionInLine());
enumerationNode.setFileName(listener.getFileName());
Parsable typeData = listener.getParsedDataStack().pop();
case LEAF_DATA:
enumerationNode.setName(((YangLeaf) tmpData).getName() + ENUMERATION_CLASS_SUFFIX);
case LEAF_LIST_DATA:
enumerationNode.setName(((YangLeafList) tmpData).getName() + ENUMERATION_CLASS_SUFFIX);
enumerationNode.setName(yangUnion.getName() + ENUMERATION_CLASS_SUFFIX
+ yangUnion.getChildUnionNumber());
YangTypeDef typeDef = (YangTypeDef) tmpData;
enumerationNode.setName(typeDef.getName() + ENUMERATION_CLASS_SUFFIX);
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
try {
SortedSet<YangEnum> set = ((YangEnumeration) typeInfo
.getDataTypeExtendedInfo()).getEnumSet();
for (YangEnum en : set) {
if (en.getNamedValue().equals(v)) {
代码示例来源:origin: org.onosproject/onos-yang-compiler-parser
boolean isValuePresent = false;
for (YangEnum curEnum : yangEnumeration.getEnumSet()) {
if (curEnum.getValue() == Integer.MAX_VALUE) {
ParserException parserException =
yangEnumeration.addEnumInfo((YangEnum) tmpEnumNode);
} catch (DataModelException e) {
ParserException parserException =
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
if (dataType.getDataType() == ENUMERATION) {
YangEnumeration enumNode = (YangEnumeration) dataType.getDataTypeExtendedInfo();
dataTypeName = enumNode.getName();
} else if (dataType.getDataType() == UNION) {
YangUnion unionNode = (YangUnion) dataType.getDataTypeExtendedInfo();
代码示例来源:origin: org.onosproject/onos-yang-compiler-parser
case ENUMERATION_DATA: {
YangEnumeration yangEnumeration = (YangEnumeration) tmpNode;
for (YangEnum curEnum : yangEnumeration.getEnumSet()) {
if (value == curEnum.getValue()) {
listener.getParsedDataStack().push(enumNode);
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
Iterator<YangEnum> iterator = ((YangEnumeration) getDataTypeExtendedInfo()).getEnumSet().iterator();
boolean isValidated = false;
while (iterator.hasNext()) {
内容来源于网络,如有侵权,请联系作者删除!