本文整理了Java中org.opendaylight.yangtools.yang.model.api.Module.getChildNodes()
方法的一些代码示例,展示了Module.getChildNodes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Module.getChildNodes()
方法的具体详情如下:
包路径:org.opendaylight.yangtools.yang.model.api.Module
类名称:Module
方法名:getChildNodes
暂无
代码示例来源:origin: org.opendaylight.yangtools/yang-model-util
@Override
public Set<DataSchemaNode> getChildNodes() {
final Set<DataSchemaNode> result = new LinkedHashSet<>();
for (Module module : getModules()) {
result.addAll(module.getChildNodes());
}
return Collections.unmodifiableSet(result);
}
代码示例来源:origin: org.opendaylight.yangtools/yang-model-util
@Override
public Set<DataSchemaNode> getDataDefinitions() {
final Set<DataSchemaNode> dataDefs = new HashSet<>();
for (Module m : getModules()) {
dataDefs.addAll(m.getChildNodes());
}
return dataDefs;
}
代码示例来源:origin: opendaylight/yangtools
@Override
public Set<DataSchemaNode> getChildNodes() {
final Set<DataSchemaNode> result = new LinkedHashSet<>();
for (Module module : getModules()) {
result.addAll(module.getChildNodes());
}
return Collections.unmodifiableSet(result);
}
代码示例来源:origin: opendaylight/yangtools
@Override
public Set<DataSchemaNode> getDataDefinitions() {
final Set<DataSchemaNode> dataDefs = new HashSet<>();
for (Module m : getModules()) {
dataDefs.addAll(m.getChildNodes());
}
return dataDefs;
}
代码示例来源:origin: org.opendaylight.netconf/sal-rest-docgen
private void processContainersAndLists(final Module module, final JSONObject models, final SchemaContext schemaContext)
throws IOException, JSONException {
String moduleName = module.getName();
for (DataSchemaNode childNode : module.getChildNodes()) {
// For every container and list in the module
if (childNode instanceof ContainerSchemaNode || childNode instanceof ListSchemaNode) {
processDataNodeContainer((DataNodeContainer) childNode, moduleName, models, true, schemaContext);
processDataNodeContainer((DataNodeContainer) childNode, moduleName, models, false, schemaContext);
}
}
}
代码示例来源:origin: org.opendaylight.netconf/mdsal-netconf-connector
/**
* Returns module's child data node of given name space and name
* @param module module
* @param nameSpace name space
* @param name name
* @return child data node schema
* @throws DocumentedException if child with given name is not present
*/
private DataSchemaNode getRootDataSchemaNode(Module module, URI nameSpace, String name) throws DocumentedException {
final Collection<DataSchemaNode> childNodes = module.getChildNodes();
for (DataSchemaNode childNode : childNodes) {
final QName qName = childNode.getQName();
if (qName.getNamespace().equals(nameSpace) && qName.getLocalName().equals(name)) {
return childNode;
}
}
throw new DocumentedException("Unable to find node with namespace: " + nameSpace + "in schema context: " + schemaContext.getCurrentContext().toString(),
DocumentedException.ErrorType.application,
DocumentedException.ErrorTag.unknown_namespace,
DocumentedException.ErrorSeverity.error);
}
代码示例来源:origin: org.opendaylight.yangtools/binding-generator-impl
private void moduleToGenTypes(final Module m, final SchemaContext context) {
genCtx.put(m, new ModuleContext());
allTypeDefinitionsToGenTypes(m);
groupingsToGenTypes(m, m.getGroupings());
rpcMethodsToGenType(m);
allIdentitiesToGenTypes(m, context);
notificationsToGenType(m);
if (!m.getChildNodes().isEmpty()) {
final GeneratedTypeBuilder moduleType = moduleToDataType(m);
genCtx.get(m).addModuleNode(moduleType);
final String basePackageName = BindingMapping.getRootPackageName(m.getQNameModule());
resolveDataSchemaNodes(m, basePackageName, moduleType, moduleType, m.getChildNodes());
}
}
代码示例来源:origin: org.opendaylight.mdsal/mdsal-binding-generator-impl
private ModuleContext moduleToGenTypes(final Module module) {
final ModuleContext context = new ModuleContext(module);
genCtx.put(module.getQNameModule(), context);
allTypeDefinitionsToGenTypes(context);
groupingsToGenTypes(context, module.getGroupings());
rpcMethodsToGenType(context);
allIdentitiesToGenTypes(context);
notificationsToGenType(context);
if (!module.getChildNodes().isEmpty()) {
final GeneratedTypeBuilder moduleType = moduleToDataType(context);
context.addModuleNode(moduleType);
resolveDataSchemaNodes(context, moduleType, moduleType, module.getChildNodes());
}
return context;
}
代码示例来源:origin: org.opendaylight.netconf/sal-rest-docgen
private void addRootPostLink(final Module module, final DataNodeContainer node, final List<Parameter> pathParams,
final String resourcePath, final List<Api> apis) {
if (containsListOrContainer(module.getChildNodes())) {
final Api apiForRootPostUri = new Api();
apiForRootPostUri.setPath(resourcePath);
apiForRootPostUri.setOperations(operationPost(module.getName() + MODULE_NAME_SUFFIX,
module.getDescription(), module, pathParams, true));
apis.add(apiForRootPostUri);
}
}
代码示例来源:origin: org.opendaylight.netconf/sal-rest-docgen
boolean hasAddRootPostLink = false;
Collection<DataSchemaNode> dataSchemaNodes = m.getChildNodes();
LOG.debug("child nodes size [{}]", dataSchemaNodes.size());
for (DataSchemaNode node : dataSchemaNodes) {
代码示例来源:origin: opendaylight/yangtools
LeafRefContext buildLeafRefContextTree() throws LeafRefYangSyntaxErrorException {
final LeafRefContextBuilder rootBuilder = new LeafRefContextBuilder(schemaContext.getQName(),
schemaContext.getPath(), schemaContext);
final Set<Module> modules = schemaContext.getModules();
for (final Module module : modules) {
for (final DataSchemaNode childNode : module.getChildNodes()) {
final LeafRefContext childLeafRefContext = buildLeafRefContextReferencingTree(childNode, module);
if (childLeafRefContext.hasReferencingChild() || childLeafRefContext.isReferencing()) {
rootBuilder.addReferencingChild(childLeafRefContext, childLeafRefContext.getNodeName());
}
}
}
for (final Module module : modules) {
final Collection<DataSchemaNode> childNodes = module.getChildNodes();
for (final DataSchemaNode childNode : childNodes) {
final LeafRefContext childLeafRefContext = buildLeafRefContextReferencedByTree(childNode, module);
if (childLeafRefContext.hasReferencedChild() || childLeafRefContext.isReferenced()) {
rootBuilder.addReferencedByChild(childLeafRefContext, childLeafRefContext.getNodeName());
}
}
}
// FIXME: it might be useful to merge these subtrees (i.e. referencing
// and referencedBy subtree)
return rootBuilder.build();
}
代码示例来源:origin: org.opendaylight.yangtools/yang-data-impl
LeafRefContext buildLeafRefContextTree() throws LeafRefYangSyntaxErrorException {
final LeafRefContextBuilder rootBuilder = new LeafRefContextBuilder(schemaContext.getQName(),
schemaContext.getPath(), schemaContext);
final Set<Module> modules = schemaContext.getModules();
for (final Module module : modules) {
for (final DataSchemaNode childNode : module.getChildNodes()) {
final LeafRefContext childLeafRefContext = buildLeafRefContextReferencingTree(childNode, module);
if (childLeafRefContext.hasReferencingChild() || childLeafRefContext.isReferencing()) {
rootBuilder.addReferencingChild(childLeafRefContext, childLeafRefContext.getNodeName());
}
}
}
for (final Module module : modules) {
final Collection<DataSchemaNode> childNodes = module.getChildNodes();
for (final DataSchemaNode childNode : childNodes) {
final LeafRefContext childLeafRefContext = buildLeafRefContextReferencedByTree(childNode, module);
if (childLeafRefContext.hasReferencedChild() || childLeafRefContext.isReferenced()) {
rootBuilder.addReferencedByChild(childLeafRefContext, childLeafRefContext.getNodeName());
}
}
}
// FIXME: it might be useful to merge these subtrees (i.e. referencing
// and referencedBy subtree)
return rootBuilder.build();
}
代码示例来源:origin: org.opendaylight.yangtools/binding-generator-impl
Collection<DataSchemaNode> _childNodes = module.getChildNodes();
boolean _isNullOrEmpty_1 = IterableExtensions.isNullOrEmpty(_childNodes);
boolean _not_1 = (!_isNullOrEmpty_1);
_builder.newLine();
_builder.append(" ");
Collection<DataSchemaNode> _childNodes_1 = module.getChildNodes();
CharSequence _writeDataSchemaNodes = YangTemplate.writeDataSchemaNodes(_childNodes_1);
_builder.append(_writeDataSchemaNodes, " ");
内容来源于网络,如有侵权,请联系作者删除!