本文整理了Java中org.onosproject.yangutils.datamodel.YangLeaf.getName()
方法的一些代码示例,展示了YangLeaf.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangLeaf.getName()
方法的具体详情如下:
包路径:org.onosproject.yangutils.datamodel.YangLeaf
类名称:YangLeaf
方法名:getName
[英]Retrieve the name of leaf.
[中]检索leaf的名称。
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Sets leaf namespace and add itself to parent child schema map.
*
* @param nameSpace namespace
*/
public void setLeafNameSpaceAndAddToParentSchemaMap(YangNamespace nameSpace) {
setNameSpace(nameSpace);
// Process addition of leaf to schema node map.
((YangNode) getContainedIn()).processAdditionOfSchemaNodeToCurNodeMap(getName(), getNameSpace(), this);
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Detects the colliding identifier name in a given leaf node.
*
* @param listOfLeaf List of leaves to detect collision
* @param identifierName name for which collision detection is to be checked
* @throws DataModelException a violation of data model rules
*/
private static void detectCollidingLeaf(List<YangLeaf> listOfLeaf, String identifierName)
throws DataModelException {
if (listOfLeaf == null) {
return;
}
for (YangLeaf leaf : listOfLeaf) {
if (leaf.getName().equals(identifierName)) {
throw new DataModelException("YANG file error: Duplicate input identifier detected, same as leaf \"" +
leaf.getName() + " in " +
leaf.getLineNumber() + " at " +
leaf.getCharPosition() +
" in " + leaf.getFileName() + "\"");
}
}
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Returns the leaf which unique refers.
*
* @param nodeForLeaf last node where leaf is referred
* @param leafInUnique leaf in unique path
* @return YANG leaf
*/
private static YangLeaf getReferenceLeafFromUnique(YangNode nodeForLeaf, YangAtomicPath leafInUnique) {
YangLeavesHolder leavesHolder = (YangLeavesHolder) nodeForLeaf;
List<YangLeaf> leaves = leavesHolder.getListOfLeaf();
if (leaves != null && !leaves.isEmpty()) {
for (YangLeaf leaf : leaves) {
if (leafInUnique.getNodeIdentifier().getName().equals(leaf.getName())) {
return leaf;
}
}
}
return null;
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
@Override
public int getMandatoryChildCount()
throws DataModelException {
throw new DataModelException("Leaf can't have child. " +
getName() + " in " +
getLineNumber() + " at " +
getCharPosition() +
" in " + getFileName() + "\"");
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
@Override
public YangSchemaNodeContextInfo getChildSchema(
YangSchemaNodeIdentifier dataNodeIdentifier)
throws DataModelException {
throw new DataModelException("leaf cannot have any child schema nodes " +
getName() + " in " +
getLineNumber() + " at " +
getCharPosition() +
" in " + getFileName() + "\"");
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
if (leaves != null && !leaves.isEmpty()) {
for (YangLeaf leaf : leaves) {
if (key.equals(leaf.getName())) {
if (leaf.getDataType().getDataType() == YangDataTypes.EMPTY) {
throw new DataModelException(" A leaf that is part of the key must not be the built-in " +
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
case LEAF_DATA:
enumerationNode.setName(((YangLeaf) tmpData).getName() + ENUMERATION_CLASS_SUFFIX);
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
bitsNode.setBitsName(((YangLeaf) tmpData).getName());
break;
case LEAF_LIST_DATA:
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
case LEAF_DATA:
unionNode.setName(((YangLeaf) tmpData).getName() + UNION_CLASS_SUFFIX);
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
if (list.isConfig()) {
for (String key : list.getKeyList()) {
if (key.equals(leaf.getName())) {
leaf.setKeyLeaf(true);
代码示例来源:origin: org.onosproject/onos-yang-datamodel
try {
((CollisionDetector) usesParent)
.detectCollidingChild(leaf.getName(), LEAF_DATA);
clonedLeaf = leaf.clone();
clonedLeaf.setReferredLeaf(leaf);
内容来源于网络,如有侵权,请联系作者删除!