@Override
 public void addTypedef(final TypeDefinitionBuilder type) {
   checkNotSealed();
   String typeName = type.getQName().getLocalName();
   for (TypeDefinitionBuilder addedTypedef : addedTypedefs) {
     if (addedTypedef.getQName().getLocalName().equals(typeName)) {
       throw new YangParseException(
           getModuleName(),
           type.getLine(),
           "Can not add typedef '"
               + typeName
               + "': typedef with same name already declared at line "
               + addedTypedef.getLine());
     }
   }
   addedTypedefs.add(type);
 }
  protected void buildChildren() {
    checkNotSealed();
    seal();

    for (DataSchemaNodeBuilder node : addedChildNodes) {
      childNodes.put(node.getQName(), node.build());
    }

    for (GroupingBuilder builder : addedGroupings) {
      groupings.add(builder.build());
    }

    for (TypeDefinitionBuilder entry : addedTypedefs) {
      typedefs.add(entry.build());
    }

    for (UsesNodeBuilder builder : addedUsesNodes) {
      usesNodes.add(builder.build());
    }
  }