本文整理了Java中org.onosproject.yang.compiler.datamodel.YangDeviateReplace
类的一些代码示例,展示了YangDeviateReplace
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangDeviateReplace
类的具体详情如下:
包路径:org.onosproject.yang.compiler.datamodel.YangDeviateReplace
类名称:YangDeviateReplace
[英]Represents deviate replace data represented in YANG.
[中]表示以YANG表示的偏离替换数据。
代码示例来源: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 replace).
*
* @param listener listener's object
* @param ctx context object of the grammar rule
*/
public static void processDeviateReplaceEntry(TreeWalkListener listener,
GeneratedYangParser
.DeviateReplaceStatementContext ctx) {
// Check for stack to be non empty.
checkStackIsNotEmpty(listener, MISSING_HOLDER, DEVIATE_REPLACE,
null, ENTRY);
// TODO : Validate sub-statements cardinality
Parsable curData = listener.getParsedDataStack().peek();
if (curData instanceof YangDeviation) {
YangDeviation curNode = (YangDeviation) curData;
YangDeviateReplace deviationReplace = new YangDeviateReplace();
curNode.addDeviateReplace(deviationReplace);
listener.getParsedDataStack().push(deviationReplace);
} else {
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, DEVIATE_REPLACE,
null, ENTRY));
}
}
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
&& deviateReplace.getDataType() != null) {
((YangLeaf) targetNode).setDataType(deviateReplace.getDataType());
&& deviateReplace.getDataType() != null) {
((YangLeafList) targetNode).setDataType(deviateReplace
.getDataType());
((YangConfig) targetNode).setConfig(deviateReplace.isConfig());
((YangUnits) targetNode).setUnits(deviateReplace.getUnits());
.setDefaultValueInString(deviateReplace.getDefaultValueInString());
((YangMandatory) targetNode).setMandatory(deviateReplace.isMandatory());
.setMinElements(deviateReplace.getMinElements());
.setMaxElements(deviateReplace.getMaxElements());
代码示例来源:origin: org.onosproject/onos-yang-compiler-parser
case DEVIATE_REPLACE:
YangDeviateReplace replace = (YangDeviateReplace) tmpData;
replace.setUnits(ctx.string().getText());
break;
default:
代码示例来源:origin: org.onosproject/onos-yang-compiler-parser
case DEVIATE_REPLACE:
YangDeviateReplace replace = (YangDeviateReplace) tmpData;
replace.setDataType(type);
break;
default:
内容来源于网络,如有侵权,请联系作者删除!