本文整理汇总了Java中org.opendaylight.yangtools.yang.model.api.SchemaNode.getUnknownSchemaNodes方法的典型用法代码示例。如果您正苦于以下问题:Java SchemaNode.getUnknownSchemaNodes方法的具体用法?Java SchemaNode.getUnknownSchemaNodes怎么用?Java SchemaNode.getUnknownSchemaNodes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.yangtools.yang.model.api.SchemaNode
的用法示例。
在下文中一共展示了SchemaNode.getUnknownSchemaNodes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findQNameFromGrouping
import org.opendaylight.yangtools.yang.model.api.SchemaNode; //导入方法依赖的package包/类
/**
* Find "proper" qname of unknown node in case it comes from a grouping
*/
private static QName findQNameFromGrouping(final DataNodeContainer subtree, final SchemaContext ctx, final UnknownSchemaNode unknownSchemaNode, final String localIdentityName) {
QName identityQName = null;
for (UsesNode usesNode : subtree.getUses()) {
SchemaNode dataChildByName = SchemaContextUtil.findDataSchemaNode(ctx, usesNode.getGroupingPath());
Module m = SchemaContextUtil.findParentModule(ctx, dataChildByName);
List<UnknownSchemaNode> unknownSchemaNodes = dataChildByName.getUnknownSchemaNodes();
if(Collections2.transform(unknownSchemaNodes, UNKNOWN_NODE_TO_STRING).contains(UNKNOWN_NODE_TO_STRING.apply(unknownSchemaNode))) {
identityQName = QName.create(dataChildByName.getQName(), localIdentityName);
}
}
return identityQName;
}
示例2: convertToJavaName
import org.opendaylight.yangtools.yang.model.api.SchemaNode; //导入方法依赖的package包/类
public static String convertToJavaName(final SchemaNode schemaNode,
final boolean capitalizeFirstLetter) {
for (final UnknownSchemaNode unknownNode : schemaNode.getUnknownSchemaNodes()) {
if (ConfigConstants.JAVA_NAME_PREFIX_EXTENSION_QNAME
.equals(unknownNode.getNodeType())) {
final String value = unknownNode.getNodeParameter();
return convertToJavaName(value, capitalizeFirstLetter);
}
}
return convertToJavaName(schemaNode.getQName().getLocalName(),
capitalizeFirstLetter);
}
示例3: getIdentitiesToRpcs
import org.opendaylight.yangtools.yang.model.api.SchemaNode; //导入方法依赖的package包/类
private static Multimap<QName/* of identity */, RpcDefinition> getIdentitiesToRpcs(
final SchemaContext schemaCtx) {
Multimap<QName, RpcDefinition> result = HashMultimap.create();
for (Module currentModule : schemaCtx.getModules()) {
// Find all identities in current module for later identity->rpc mapping
Set<QName> allIdentitiesInModule =
Sets.newHashSet(Collections2.transform(currentModule.getIdentities(), SchemaNode::getQName));
for (RpcDefinition rpc : currentModule.getRpcs()) {
ContainerSchemaNode input = rpc.getInput();
if (input != null) {
for (UsesNode uses : input.getUses()) {
// Check if the rpc is config rpc by looking for input argument rpc-context-ref
Iterator<QName> pathFromRoot = uses.getGroupingPath().getPathFromRoot().iterator();
if (!pathFromRoot.hasNext() ||
!pathFromRoot.next().equals(ConfigConstants.RPC_CONTEXT_REF_GROUPING_QNAME)) {
continue;
}
for (SchemaNode refinedNode : uses.getRefines().values()) {
for (UnknownSchemaNode unknownSchemaNode : refinedNode
.getUnknownSchemaNodes()) {
if (ConfigConstants.RPC_CONTEXT_INSTANCE_EXTENSION_QNAME
.equals(unknownSchemaNode.getNodeType())) {
String localIdentityName = unknownSchemaNode
.getNodeParameter();
QName identityQName = QName.create(
currentModule.getNamespace(),
currentModule.getRevision(),
localIdentityName);
Preconditions.checkArgument(allIdentitiesInModule.contains(identityQName),
"Identity referenced by rpc not found. Identity: %s, rpc: %s", localIdentityName, rpc);
result.put(identityQName, rpc);
}
}
}
}
}
}
}
return result;
}