本文整理了Java中org.onosproject.yang.compiler.datamodel.YangDeviateDelete
类的一些代码示例,展示了YangDeviateDelete
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangDeviateDelete
类的具体详情如下:
包路径:org.onosproject.yang.compiler.datamodel.YangDeviateDelete
类名称:YangDeviateDelete
[英]Represents deviate delete data represented in YANG.
[中]表示以YANG表示的偏离删除数据。
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
/**
* Updates the target data model with deviate delete sub statements.
*
* @param targetNode target node of deviation
* @param deviateDelete YANG deviate delete data model node
* @throws DataModelException if deviations referring to multiple module
*/
public static void updateDeviateDeleteToTargetNode(YangSchemaNode targetNode,
YangDeviateDelete deviateDelete)
throws DataModelException {
// delete must statement
if (targetNode instanceof YangMustHolder
&& !deviateDelete.getListOfMust().isEmpty()) {
deviateDelete.setListOfMust(new LinkedList<>());
}
// delete unique statement
if (targetNode instanceof YangUniqueHolder
&& !deviateDelete.getPathList().isEmpty()) {
deviateDelete.setPathList(new LinkedList<>());
}
// delete units statement
if (targetNode instanceof YangUnits) {
((YangUnits) targetNode).setUnits(null);
}
// delete default statement
if (targetNode instanceof YangDefault) {
((YangDefault) targetNode)
.setDefaultValueInString(null);
}
}
代码示例来源:origin: org.onosproject/onos-yang-compiler-parser
/**
* Performs validation and updates the data model tree. It is called when
* parser receives an input matching the grammar rule(deviate delete).
*
* @param listener listener's object
* @param ctx context object of the grammar rule
*/
public static void processDeviateDeleteEntry(TreeWalkListener listener,
GeneratedYangParser
.DeviateDeleteStatementContext ctx) {
// Check for stack to be non empty.
checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_DELETE,
null, ENTRY);
// TODO : Validate sub-statements cardinality
Parsable curData = listener.getParsedDataStack().peek();
if (curData instanceof YangDeviation) {
YangDeviation curNode = (YangDeviation) curData;
YangDeviateDelete deviateDelete = new YangDeviateDelete();
curNode.addDeviatedelete(deviateDelete);
listener.getParsedDataStack().push(deviateDelete);
} else {
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER,
DEVIATE_DELETE,
null,
ENTRY));
}
}
代码示例来源:origin: org.onosproject/onos-yang-compiler-parser
case DEVIATE_DELETE:
YangDeviateDelete deviateDelete = (YangDeviateDelete) tmpData;
deviateDelete.setUnits(ctx.string().getText());
break;
case DEVIATE_REPLACE:
内容来源于网络,如有侵权,请联系作者删除!