本文整理了Java中org.onosproject.yang.compiler.datamodel.YangList.getKeyList()
方法的一些代码示例,展示了YangList.getKeyList()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangList.getKeyList()
方法的具体详情如下:
包路径:org.onosproject.yang.compiler.datamodel.YangList
类名称:YangList
方法名:getKeyList
[英]Returns the set of key field names.
[中]返回一组键字段名。
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
/**
* Adds a key field name.
*
* @param key key field name.
* @throws DataModelException a violation of data model rules
*/
public void addKey(String key)
throws DataModelException {
if (getKeyList() == null) {
setKeyList(new LinkedHashSet<String>());
}
if (getKeyList().contains(key)) {
throw new DataModelException("A leaf identifier must not appear more than once in the\n" +
" key" +
getName() + " in " +
getLineNumber() + " at " +
getCharPosition() +
" in " + getFileName() + "\"");
}
getKeyList().add(key);
}
代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel
/**
* Validates the data on exiting the corresponding parse tree node.
*
* @throws DataModelException a violation of data model rules
*/
@Override
public void validateDataOnExit()
throws DataModelException {
LinkedHashSet<String> keys = getKeyList();
List<YangLeaf> leaves = getListOfLeaf();
List<YangLeafList> leafLists = getListOfLeafList();
validateConfig(leaves, leafLists);
//A list must have atleast one key leaf if config is true
if (isConfig && (keys.isEmpty() || leaves.isEmpty()) && !isUsesPresentInList()
&& !isListPresentInGrouping()) {
throw new DataModelException("A list must have atleast one key leaf if config is true; " +
getName() + " in " +
getLineNumber() + " at " +
getCharPosition() +
" in " + getFileName() + "\"");
} else if (keys != null) {
validateKey(leaves, keys);
}
}
代码示例来源:origin: org.onosproject/onos-yang-compiler-parser
if (tmpData instanceof YangList) {
YangList list = (YangList) tmpData;
for (String key : list.getKeyList()) {
if (key.equals(leaf.getName())) {
leaf.setKeyLeaf(true);
内容来源于网络,如有侵权,请联系作者删除!