本文整理了Java中org.onosproject.yangutils.datamodel.YangFeature
类的一些代码示例,展示了YangFeature
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangFeature
类的具体详情如下:
包路径:org.onosproject.yangutils.datamodel.YangFeature
类名称:YangFeature
[英]Represents data model node to maintain information defined in YANG feature.
[中]表示数据模型节点,以维护要素中定义的信息。
代码示例来源:origin: org.onosproject/onos-yang-datamodel
@Override
public void addIfFeatureList(YangIfFeature ifFeature) {
if (getIfFeatureList() == null) {
setIfFeatureList(new LinkedList<>());
}
getIfFeatureList().add(ifFeature);
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Performs validation and updates the data model tree.It is called when parser receives
* an input matching the grammar rule (feature).
*
* @param listener listener's object
* @param ctx context object of the grammar rule
*/
public static void processFeatureEntry(TreeWalkListener listener,
GeneratedYangParser.FeatureStatementContext ctx) {
// Check for stack to be non empty.
checkStackIsNotEmpty(listener, MISSING_HOLDER, FEATURE_DATA, ctx.string().getText(), ENTRY);
String identifier = getValidIdentifier(ctx.string().getText(), FEATURE_DATA, ctx);
// Obtain the node of the stack.
Parsable tmpNode = listener.getParsedDataStack().peek();
if (tmpNode instanceof YangFeatureHolder) {
YangFeatureHolder featureHolder = (YangFeatureHolder) tmpNode;
YangFeature feature = new YangFeature();
feature.setName(identifier);
feature.setLineNumber(ctx.getStart().getLine());
feature.setCharPosition(ctx.getStart().getCharPositionInLine());
feature.setFileName(listener.getFileName());
featureHolder.addFeatureList(feature);
listener.getParsedDataStack().push(feature);
} else {
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, FEATURE_DATA,
ctx.string().getText(), ENTRY));
}
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
@Override
public Object resolve() throws DataModelException {
YangFeature feature = getReferredFeature();
// check whether feature has if-feature
List<YangIfFeature> ifFeatureList = feature.getIfFeatureList();
if (ifFeatureList != null && !ifFeatureList.isEmpty()) {
Iterator<YangIfFeature> ifFeatureIterator = ifFeatureList.iterator();
while (ifFeatureIterator.hasNext()) {
YangIfFeature ifFeature = ifFeatureIterator.next();
if (ifFeature.getResolvableStatus() != ResolvableStatus.RESOLVED) {
setResolvableStatus(ResolvableStatus.INTRA_FILE_RESOLVED);
return null;
}
}
}
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!