+ public ChoiceBuilder addChoice(final QName choiceName,
+ final List<String> parentPath) {
+ List<String> pathToChoice = new ArrayList<String>(parentPath);
+ ChoiceBuilder builder = new ChoiceBuilder(choiceName);
+
+ final ChildNodeBuilder parent = (ChildNodeBuilder) moduleNodes
+ .get(pathToChoice);
+ if (parent != null) {
+ if (parent instanceof AugmentationSchemaBuilder) {
+ builder.setAugmenting(true);
+ }
+ parent.addChildNode(builder);
+ }
+
+ pathToChoice.add(choiceName.getLocalName());
+ addedChilds.put(pathToChoice, builder);
+ moduleNodes.put(pathToChoice, builder);
+
+ return builder;
+ }
+
+ public ChoiceCaseBuilder addCase(final QName caseName,
+ final List<String> parentPath) {
+ List<String> pathToCase = new ArrayList<String>(parentPath);
+ ChoiceCaseBuilder builder = new ChoiceCaseBuilder(caseName);
+
+ final ChildNodeBuilder parent = (ChildNodeBuilder) moduleNodes
+ .get(pathToCase);
+ if (parent != null) {
+ if (parent instanceof AugmentationSchemaBuilder) {
+ builder.setAugmenting(true);
+ }
+ parent.addChildNode(builder);
+ }
+
+ pathToCase.add(caseName.getLocalName());
+ moduleNodes.put(pathToCase, builder);
+
+ return builder;
+ }
+
+ public AnyXmlBuilder addAnyXml(final QName anyXmlName,
+ final List<String> parentPath) {
+ List<String> pathToAnyXml = new ArrayList<String>(parentPath);
+ AnyXmlBuilder builder = new AnyXmlBuilder(anyXmlName);
+
+ final ChildNodeBuilder parent = (ChildNodeBuilder) moduleNodes
+ .get(pathToAnyXml);
+ if (parent != null) {
+ if (parent instanceof AugmentationSchemaBuilder) {
+ throw new UnsupportedOperationException(
+ "An anyxml node cannot be augmented.");
+ }
+ parent.addChildNode(builder);
+ }
+
+ pathToAnyXml.add(anyXmlName.getLocalName());
+ addedChilds.put(pathToAnyXml, builder);
+ moduleNodes.put(pathToAnyXml, builder);
+
+ return builder;
+ }
+
+ public TypedefBuilder addTypedef(final QName typeDefName,
+ final List<String> parentPath) {