private GeneratedType actionContainer(final ModuleContext context, final Type baseInterface, final ContainerSchemaNode schema) { final GeneratedTypeBuilder genType = processDataSchemaNode(context, baseInterface, schema); resolveDataSchemaNodes(context, genType, genType, schema.getChildNodes()); return genType.build(); }
public static RpcRoutingStrategy from(final RpcDefinition rpc) { ContainerSchemaNode input = rpc.getInput(); if (input != null) { for (DataSchemaNode schemaNode : input.getChildNodes()) { Optional<QName> context = getRoutingContext(schemaNode); if (context.isPresent()) { return new RoutedRpcStrategy(rpc.getQName(), context.get(), schemaNode.getQName()); } } } return new GlobalRpcStrategy(rpc.getQName()); }
public static RpcRoutingStrategy from(final RpcDefinition rpc) { ContainerSchemaNode input = rpc.getInput(); if (input != null) { for (DataSchemaNode schemaNode : input.getChildNodes()) { Optional<QName> context = getRoutingContext(schemaNode); if (context.isPresent()) { return new RoutedRpcStrategy(rpc.getQName(), context.get(), schemaNode.getQName()); } } } return new GlobalRpcStrategy(rpc.getQName()); }
private void containerToGenType(final ModuleContext context, final GeneratedTypeBuilder parent, final Type baseInterface, final ContainerSchemaNode node) { final GeneratedTypeBuilder genType = processDataSchemaNode(context, baseInterface, node); if (genType != null) { constructGetter(parent, genType, node); resolveDataSchemaNodes(context, genType, genType, node.getChildNodes()); actionsToGenType(context, genType, node, null); } }
public static RpcRoutingStrategy from(final RpcDefinition rpc) { for (DataSchemaNode schemaNode : rpc.getInput().getChildNodes()) { Optional<QName> context = getRoutingContext(schemaNode); if (context.isPresent()) { return new RoutedRpcStrategy(rpc.getQName(), context.get(), schemaNode.getQName()); } } return new GlobalRpcStrategy(rpc.getQName()); }
private void containerToGenType(final Module module, final String basePackageName, final GeneratedTypeBuilder parent, final GeneratedTypeBuilder childOf, final ContainerSchemaNode node) { final GeneratedTypeBuilder genType = processDataSchemaNode(module, basePackageName, childOf, node); if (genType != null) { constructGetter(parent, node.getQName().getLocalName(), node.getDescription(), genType); resolveDataSchemaNodes(module, basePackageName, genType, genType, node.getChildNodes()); } }
public static CharSequence writeRpcInput(final ContainerSchemaNode input) { CharSequence _xblockexpression = null; { boolean _equals = Objects.equal(input, null); if (_equals) { return ""; } StringConcatenation _builder = new StringConcatenation(); _builder.append("input {"); _builder.newLine(); { Collection<DataSchemaNode> _childNodes = input.getChildNodes(); boolean _isNullOrEmpty = IterableExtensions.isNullOrEmpty(_childNodes); boolean _not = (!_isNullOrEmpty); if (_not) { _builder.append(" "); Collection<DataSchemaNode> _childNodes_1 = input.getChildNodes(); CharSequence _writeDataSchemaNodes = YangTemplate.writeDataSchemaNodes(_childNodes_1); _builder.append(_writeDataSchemaNodes, " "); _builder.newLineIfNotEmpty(); } } _builder.append("}"); _builder.newLine(); _builder.newLine(); _xblockexpression = _builder; } return _xblockexpression; }
public static CharSequence writeRpcOutput(final ContainerSchemaNode output) { CharSequence _xblockexpression = null; { boolean _equals = Objects.equal(output, null); if (_equals) { return ""; } StringConcatenation _builder = new StringConcatenation(); _builder.append("output {"); _builder.newLine(); { Collection<DataSchemaNode> _childNodes = output.getChildNodes(); boolean _isNullOrEmpty = IterableExtensions.isNullOrEmpty(_childNodes); boolean _not = (!_isNullOrEmpty); if (_not) { _builder.append(" "); Collection<DataSchemaNode> _childNodes_1 = output.getChildNodes(); CharSequence _writeDataSchemaNodes = YangTemplate.writeDataSchemaNodes(_childNodes_1); _builder.append(_writeDataSchemaNodes, " "); _builder.newLineIfNotEmpty(); } } _builder.append("}"); _builder.newLine(); _xblockexpression = _builder; } return _xblockexpression; }
AttributeIfc returnType; if (rpcDefinition.getOutput() == null || rpcDefinition.getOutput().getChildNodes().isEmpty()) { returnType = VoidAttribute.getInstance(); } else if (rpcDefinition.getOutput().getChildNodes().size() == 1) { DataSchemaNode returnDSN = rpcDefinition.getOutput() .getChildNodes().iterator().next(); returnType = getReturnTypeAttribute(returnDSN, typeProviderWrapper, packageName); .getChildNodes())) { if (childNode.isAddedByUses() == false) { // skip
private static AbstractDOMRpcRoutingTableEntry createRpcEntry(final SchemaContext context, final SchemaPath key, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> implementations) { final RpcDefinition rpcDef = findRpcDefinition(context, key); if (rpcDef != null) { final ContainerSchemaNode input = rpcDef.getInput(); if (input != null) { for (DataSchemaNode c : input.getChildNodes()) { for (UnknownSchemaNode extension : c.getUnknownSchemaNodes()) { if (CONTEXT_REFERENCE.equals(extension.getNodeType())) { final YangInstanceIdentifier keyId = YangInstanceIdentifier.of(c.getQName()); return new RoutedDOMRpcRoutingTableEntry(rpcDef, keyId, implementations); } } } } return new GlobalDOMRpcRoutingTableEntry(rpcDef, implementations); } else { return new UnknownDOMRpcRoutingTableEntry(key, implementations); } }
private Type createRpcContainer(final ModuleContext context, final String rpcName, final RpcDefinition rpc, final ContainerSchemaNode schema, final Type type) { processUsesAugments(schema, context); final GeneratedTypeBuilder outType = addRawInterfaceDefinition( JavaTypeName.create(context.modulePackageName(), rpcName + BindingMapping.getClassName(schema.getQName())), schema); addImplementedInterfaceFromUses(schema, outType); outType.addImplementsType(type); outType.addImplementsType(augmentable(outType)); annotateDeprecatedIfNecessary(rpc.getStatus(), outType); resolveDataSchemaNodes(context, outType, outType, schema.getChildNodes()); context.addChildNodeType(schema, outType); return outType.build(); }
inType.addImplementsType(DATA_OBJECT); inType.addImplementsType(augmentable(inType)); resolveDataSchemaNodes(module, basePackageName, inType, inType, input.getChildNodes()); genCtx.get(module).addChildNodeType(input, inType); final GeneratedType inTypeInstance = inType.toInstance(); outType.addImplementsType(DATA_OBJECT); outType.addImplementsType(augmentable(outType)); resolveDataSchemaNodes(module, basePackageName, outType, outType, output.getChildNodes()); genCtx.get(module).addChildNodeType(output, outType); outTypeInstance = outType.toInstance();
_builder.newLineIfNotEmpty(); Collection<DataSchemaNode> _childNodes = contSchemaNode.getChildNodes(); boolean _isNullOrEmpty = IterableExtensions.isNullOrEmpty(_childNodes); boolean _not = (!_isNullOrEmpty); if (_not) { _builder.append(" "); Collection<DataSchemaNode> _childNodes_1 = contSchemaNode.getChildNodes(); CharSequence _writeDataSchemaNodes = YangTemplate.writeDataSchemaNodes(_childNodes_1); _builder.append(_writeDataSchemaNodes, " ");