protected AbstractDocumentedDataNodeContainerBuilder(
      final String moduleName,
      final int line,
      final QName qname,
      final SchemaPath path,
      final DataNodeContainer base) {
    super(moduleName, line);
    this.qname = qname;

    // We do copy of child nodes with namespace change
    // FIXME: Copy should be part of builder API so impl we prevent
    // cyclic dependencies and each builder carries its own semantic for copy.
    addedChildNodes.addAll(
        BuilderUtils.wrapChildNodes(moduleName, line, base.getChildNodes(), path, qname));
    addedGroupings.addAll(
        BuilderUtils.wrapGroupings(moduleName, line, base.getGroupings(), path, qname));
    addedTypedefs.addAll(BuilderUtils.wrapTypedefs(moduleName, line, base, path, qname));
    // FIXME: unkownSchemaNodes should be available in DataNodeContainer
    // addedUnknownNodes.addAll(BuilderUtils.wrapUnknownNodes(moduleName,
    // line, base.getUnknownSchemaNodes(), path, qname));
    usesNodes.addAll(base.getUses());

    if (base instanceof DocumentedNode) {
      DocumentedNode node = (DocumentedNode) base;
      setDescription(node.getDescription());
      setReference(node.getReference());
      setStatus(node.getStatus());
    }
  }
コード例 #2
0
 private SchemaContext parseSchemas(Collection<InputStream> schemas)
     throws IOException, YangSyntaxErrorException {
   final YangParserImpl parser = new YangParserImpl();
   Collection<ByteSource> sources = BuilderUtils.streamsToByteSources(schemas);
   return parser.parseSources(sources);
 }