本文整理了Java中org.onosproject.yangutils.datamodel.YangNodeIdentifier.setName()
方法的一些代码示例,展示了YangNodeIdentifier.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangNodeIdentifier.setName()
方法的具体详情如下:
包路径:org.onosproject.yangutils.datamodel.YangNodeIdentifier
类名称:YangNodeIdentifier
方法名:setName
[英]Sets name of the node identifier.
[中]设置节点标识符的名称。
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Sets the name of the data type.
*
* @param typeName the name to set
*/
public void setDataTypeName(String typeName) {
nodeId.setName(typeName);
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
/**
* Sets the name of identity.
*
* @param name the identity name to set
*/
@Override
public void setName(String name) {
baseIdentity.setName(name);
}
代码示例来源:origin: org.onosproject/onos-yang-datamodel
@Override
public void setName(String name) {
nodeIdentifier.setName(name);
}
代码示例来源:origin: org.onosproject/onos-yang-utils-parser
/**
* Checks and return valid node identifier.
*
* @param nodeIdentifierString string from yang file
* @param yangConstruct yang construct for creating error message
* @param ctx yang construct's context to get the line number and character position
* @return valid node identifier
*/
public static YangNodeIdentifier getValidNodeIdentifier(String nodeIdentifierString,
YangConstructType yangConstruct, ParserRuleContext ctx) {
String tmpIdentifierString = removeQuotesAndHandleConcat(nodeIdentifierString);
String[] tmpData = tmpIdentifierString.split(Pattern.quote(COLON));
if (tmpData.length == 1) {
YangNodeIdentifier nodeIdentifier = new YangNodeIdentifier();
nodeIdentifier.setName(getValidIdentifier(tmpData[0], yangConstruct, ctx));
return nodeIdentifier;
} else if (tmpData.length == 2) {
YangNodeIdentifier nodeIdentifier = new YangNodeIdentifier();
nodeIdentifier.setPrefix(getValidIdentifier(tmpData[0], yangConstruct, ctx));
nodeIdentifier.setName(getValidIdentifier(tmpData[1], yangConstruct, ctx));
return nodeIdentifier;
} else {
ParserException parserException = new ParserException("YANG file error : " +
getYangConstructType(yangConstruct) + " name " + nodeIdentifierString +
" is not valid.");
parserException.setLine(ctx.getStart().getLine());
parserException.setCharPosition(ctx.getStart().getCharPositionInLine());
throw parserException;
}
}
内容来源于网络,如有侵权,请联系作者删除!