- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.onosproject.yangutils.datamodel.YangNode
类的一些代码示例,展示了YangNode
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangNode
类的具体详情如下:
包路径:org.onosproject.yangutils.datamodel.YangNode
类名称:YangNode
[英]Represents base class of a node in data model tree.
[中]表示数据模型树中节点的基类。
代码示例来源:origin: org.onosproject/onos-yang-datamodel
if (newChild.getNodeType() == null) {
throw new DataModelException("Abstract node cannot be inserted " +
"into a tree " + getName() +
" in " + getLineNumber() +
" at " + getCharPosition() +
" in " + getFileName() + "\"");
if (newChild.getParent() == null) {
newChild.setParent(this);
} else if (newChild.getParent() != this) {
throw new DataModelException("Node is already part of a tree " +
getName() + " in " +
getLineNumber() + " at " +
getCharPosition() + " in " +
getFileName() + "\"");
if (newChild.getChild() != null) {
throw new DataModelException("Child to be added is not atomic, " +
"it already has a child " +
getName() + " in " +
getLineNumber() + " at " +
getCharPosition() + " in " +
getFileName() + "\"");
if (newChild.getNextSibling() != null) {
throw new DataModelException("Child to be added is not atomic, " +
"it already has a next " +
"sibling " + getName() +
" in " + getLineNumber() +
代码示例来源:origin: org.onosproject/onos-yang-datamodel
nextNodeToClone = nextNodeToClone.getChild();
if (nextNodeToClone == null) {
return;
"tree null pointer " +
"reached " +
nextNodeToClone.getName() +
" in " + nextNodeToClone.getLineNumber() +
" at " + nextNodeToClone.getCharPosition() +
" in " + nextNodeToClone.getFileName() + "\"");
newNode = nextNodeToClone.clone(yangUses);
detectCollisionWhileCloning(clonedTreeCurNode, newNode,
curTraversal);
clonedTreeCurNode.addChild(newNode);
clonedTreeCurNode.addNextSibling(newNode);
clonedTreeCurNode = newNode;
} else {
clonedTreeCurNode = clonedTreeCurNode.getParent();
if (curTraversal != PARENT && nextNodeToClone.getChild() != null) {
curTraversal = CHILD;
nextNodeToClone = nextNodeToClone.getChild();
} else if (nextNodeToClone.getNextSibling() != null) {
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Processes addition of schema node child to parent map.
*
* @param name name of the node
* @param namespace namespace of the node
*/
protected void processAdditionOfSchemaNodeToParentMap(String name,
YangNamespace namespace) {
processAdditionOfSchemaNodeToMap(name, namespace, this, getParent());
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Returns true if op type info required for node.
*
* @return true if op type info required for node
*/
public boolean isOpTypeReq() {
return this instanceof RpcNotificationContainer ||
!(this instanceof InvalidOpTypeHolder) &&
getParent().isOpTypeReq();
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Checks if there is any rpc defined in the module or sub-module.
*
* @param rootNode root node of the data model
* @return status of rpc's existence
*/
public static boolean isRpcChildNodePresent(YangNode rootNode) {
YangNode childNode = rootNode.getChild();
while (childNode != null) {
if (childNode instanceof YangRpc) {
return true;
}
childNode = childNode.getNextSibling();
}
return false;
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
@Override
public void isValueValid(String value)
throws DataModelException {
throw new DataModelException("Value validation asked for YANG node. "
+ getName() + " in " +
getLineNumber() + " at " +
getCharPosition()
+ " in " + getFileName() + "\"");
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
while (curNode != null) {
if (curNode == referredGrouping || (curNode instanceof YangUses &&
curNode.getName().equals(referredGrouping.getName()))) {
if (curTraversal != PARENT && curNode.getChild() != null) {
curTraversal = CHILD;
curNode = curNode.getChild();
} else if (curNode.getNextSibling() != null) {
curTraversal = SIBILING;
curNode = curNode.getNextSibling();
} else {
curTraversal = PARENT;
curNode = curNode.getParent();
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Adds namespace for self, next sibling and first child. This is used
* after obtaining namespace in case of submodule after performing
* linking.
*/
public void setNameSpaceAndAddToParentSchemaMap() {
// Get parent namespace.
if (getParent() != null) {
// Get parent namespace and set namespace for self node.
setNameSpace(getParent().getNameSpace());
// Process addition of leaf to the child schema map of parent.
processAdditionOfSchemaNodeToParentMap(getName(), getNameSpace());
} else {
// Module/Sub-module
setNameSpace((YangNamespace) this);
}
/*
* Check if node contains leaf/leaf-list, if yes add namespace for leaf
* and leaf list.
*/
if (this instanceof YangLeavesHolder) {
((YangLeavesHolder) this).setLeafNameSpaceAndAddToParentSchemaMap();
}
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Adds the enumeration node to the parent holder.
*
* @param listener listener's object
* @param enumerationNode enumeration node which needs to be added to parent
*/
private static void addChildToParentNode(TreeWalkListener listener, YangEnumeration enumerationNode) {
if (!(listener.getParsedDataStack().peek() instanceof YangNode)) {
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, ENUMERATION_DATA,
"", ENTRY));
} else {
YangNode curNode = (YangNode) listener.getParsedDataStack().peek();
try {
curNode.addChild(enumerationNode);
} catch (DataModelException e) {
throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
YangConstructType.ENUMERATION_DATA, "", ENTRY, e.getMessage()));
}
}
}
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
" in " + leavesHolder.getFileName() + "\"");
YangNode potentialTypeNode = ((YangNode) leavesHolder).getChild();
while (potentialTypeNode != null) {
String dataTypeName = null;
dataTypeName = unionNode.getName();
if (potentialTypeNode.getName().contentEquals(dataTypeName)) {
dataType.setDataTypeExtendedInfo(potentialTypeNode);
return;
potentialTypeNode = potentialTypeNode.getNextSibling();
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Returns the node that matches with the name of the node in path.
*
* @param nodeInUnique node name in path
* @param potentialReferredNode node under which it has to match
* @return referred node
*/
private static YangNode getReferredNodeFromTheUniqueNodes(YangNodeIdentifier nodeInUnique, YangNode
potentialReferredNode) {
while (potentialReferredNode != null) {
// Check if the potential referred node is the actual referred node
if (potentialReferredNode.getName().equals(nodeInUnique.getName())) {
return potentialReferredNode;
}
potentialReferredNode = potentialReferredNode.getNextSibling();
}
return null;
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Returns referred node in a given set.
*
* @param yangNodeSet YANG node set
* @param refNodeName name of the node which is referred
* @return referred node's reference
*/
public static YangNode findReferredNode(Set<YangNode> yangNodeSet, String refNodeName) {
/*
* Run through the YANG files to see which YANG file matches the
* referred node name.
*/
for (YangNode yangNode : yangNodeSet) {
if (yangNode.getName().equals(refNodeName)) {
return yangNode;
}
}
return null;
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Returns the contained data model parent node.
*
* @param currentNode current node which parent contained node is required
* @return parent node in which the current node is an attribute
*/
public static YangNode getParentNodeInGenCode(YangNode currentNode) {
/*
* TODO: recursive parent lookup to support choice/augment/uses. TODO:
* need to check if this needs to be updated for
* choice/case/augment/grouping
*/
return currentNode.getParent();
}
代码示例来源:origin: org.onosproject/onos-yang-tool
/**
* Resolved inter-jar dependencies.
*
* @param dependentSchema dependent schema list
* @throws IOException when fails to do IO operations
*/
private void addSchemaToFileSet(List<YangNode> dependentSchema)
throws IOException {
if (dependentSchema == null || dependentSchema.isEmpty()) {
return;
}
for (YangNode node : dependentSchema) {
YangFileInfo dependentFileInfo = new YangFileInfo();
node.setToTranslate(false);
dependentFileInfo.setRootNode(node);
dependentFileInfo.setForTranslator(false);
dependentFileInfo.setYangFileName(node.getName());
yangFileInfoSet.add(dependentFileInfo);
}
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
private boolean isUsesPresentInList() {
YangNode node = getChild();
while (node != null) {
if (node instanceof YangUses) {
return true;
}
node = node.getNextSibling();
}
return false;
// TODO When grouping linking is done this method has to be modified.
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Returns the last node under the unique path.
*
* @param uniquePath atomic path list
* @param node root node from where it starts searching
* @param ctx yang construct's context to get the line number and character position
* @return last node in the list
*/
private static YangNode getNodeUnderListFromPath(List<YangAtomicPath> uniquePath, YangNode node,
ParserRuleContext ctx) {
Iterator<YangAtomicPath> nodesInReference = uniquePath.listIterator();
YangNode potentialReferredNode = node.getChild();
while (nodesInReference.hasNext()) {
YangAtomicPath nodeInUnique = nodesInReference.next();
YangNode referredNode = getReferredNodeFromTheUniqueNodes(nodeInUnique.getNodeIdentifier(),
potentialReferredNode);
if (referredNode == null) {
ParserException parserException = new ParserException("YANG file error : The target node in unique " +
"reference path is invalid");
parserException.setLine(ctx.getStart().getLine());
parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
throw parserException;
} else {
potentialReferredNode = referredNode.getChild();
}
}
return potentialReferredNode;
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
@Override
public void addToChildSchemaMap(YangSchemaNodeIdentifier id,
YangSchemaNodeContextInfo context)
throws DataModelException {
getYsnContextInfoMap().put(id, context);
YangSchemaNodeContextInfo contextInfo = new YangSchemaNodeContextInfo();
contextInfo.setSchemaNode(context.getSchemaNode());
contextInfo.setContextSwitchedNode(this);
getParent().addToChildSchemaMap(id, contextInfo);
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
YangNode.cloneSubTree(referredGrouping, usesParentNode, this);
} catch (DataModelException e) {
throw new DataModelException(e.getMessage());
代码示例来源:origin: org.onosproject/onos-yang-datamodel
throw new DataModelException("Node in data model tree does not " +
"support collision detection " +
newNode.getName() + " in " +
newNode.getLineNumber() + " at " +
newNode.getCharPosition() +
" in " + newNode.getFileName() + "\"");
Parsable parsable = (Parsable) newNode;
if (addAs == TraversalType.CHILD) {
collisionDetector.detectCollidingChild(newNode.getName(),
parsable.getYangConstructType());
} else if (addAs == TraversalType.SIBILING) {
currentNode = currentNode.getParent();
if (!(currentNode instanceof CollisionDetector)) {
throw new DataModelException("Node in data model tree does " +
"not support collision " +
"detection" + currentNode.getName() +
" in " + currentNode.getLineNumber() +
" at " + currentNode.getCharPosition() +
" in " + currentNode.getFileName() + "\"");
collisionDetector.detectCollidingChild(newNode.getName(),
parsable.getYangConstructType());
} else {
throw new DataModelException("Error tree cloning " +
currentNode.getName() + " in" +
" " + currentNode.getLineNumber() +
" at " + currentNode.getCharPosition() +
" in " + currentNode.getFileName() + "\"");
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Adds the union node to the parent holder.
*
* @param listener listener's object
* @param unionNode union node which needs to be added to parent
*/
private static void addChildToParentNode(TreeWalkListener listener, YangUnion unionNode) {
if (!(listener.getParsedDataStack().peek() instanceof YangNode)) {
throw new ParserException(constructListenerErrorMessage(INVALID_HOLDER, UNION_DATA,
"", ENTRY));
} else {
YangNode curNode = (YangNode) listener.getParsedDataStack().peek();
try {
curNode.addChild(unionNode);
} catch (DataModelException e) {
throw new ParserException(constructExtendedListenerErrorMessage(UNHANDLED_PARSED_DATA,
UNION_DATA, "", ENTRY, e.getMessage()));
}
}
}
}
本文整理了Java中org.batfish.datamodel.Zone类的一些代码示例,展示了Zone类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,
我似乎无法将文本数据(例如 CSV、JSON 或 XML 文件)添加到 Roblox DataModel 、Workspace、ServerStorage 还是任何地方? 关于如何高效执行此操作的任何
我有一个用位置更新创建的数据库,数据库中有一堆位置 x 和 y。在第二种方法中,readFirestore() 读取位置数据并比较来自 sqlite 数据库的最喜欢的位置,如果最喜欢的位置靠近来自 f
本文整理了Java中org.onosproject.yangutils.datamodel.YangReferenceResolver类的一些代码示例,展示了YangReferenceResolver
本文整理了Java中org.onosproject.yangutils.datamodel.YangNode类的一些代码示例,展示了YangNode类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.onosproject.yangutils.datamodel.YangUnion类的一些代码示例,展示了YangUnion类的具体用法。这些代码示例主要来源于Github
本文整理了Java中org.onosproject.yangutils.datamodel.YangTypeDef类的一些代码示例,展示了YangTypeDef类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.onosproject.yangutils.datamodel.YangType类的一些代码示例,展示了YangType类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.onosproject.yangutils.datamodel.YangSubModule类的一些代码示例,展示了YangSubModule类的具体用法。这些代码示例主要来
本文整理了Java中org.onosproject.yangutils.datamodel.YangRevision类的一些代码示例,展示了YangRevision类的具体用法。这些代码示例主要来源于
本文整理了Java中org.onosproject.yangutils.datamodel.YangRpc类的一些代码示例,展示了YangRpc类的具体用法。这些代码示例主要来源于Github/Sta
本文整理了Java中org.onosproject.yangutils.datamodel.YangPatternRestriction类的一些代码示例,展示了YangPatternRestricti
本文整理了Java中org.onosproject.yangutils.datamodel.YangStringRestriction类的一些代码示例,展示了YangStringRestriction
本文整理了Java中org.onosproject.yangutils.datamodel.YangFeature类的一些代码示例,展示了YangFeature类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.onosproject.yangutils.datamodel.YangLeafRef类的一些代码示例,展示了YangLeafRef类的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.onosproject.yangutils.datamodel.YangLeafList类的一些代码示例,展示了YangLeafList类的具体用法。这些代码示例主要来源于
本文整理了Java中org.onosproject.yangutils.datamodel.YangLeaf类的一些代码示例,展示了YangLeaf类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.onosproject.yangutils.datamodel.YangList类的一些代码示例,展示了YangList类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.onosproject.yangutils.datamodel.YangNodeIdentifier类的一些代码示例,展示了YangNodeIdentifier类的具体用法
本文整理了Java中org.onosproject.yangutils.datamodel.YangAugment类的一些代码示例,展示了YangAugment类的具体用法。这些代码示例主要来源于Gi
我是一名优秀的程序员,十分优秀!