- copy.setTypedef(old.getTypedef());
- } else {
- copy.setType(type);
- }
- copy.setPath(old.getPath());
- copyConstraints(old, copy);
- for (UnknownSchemaNodeBuilder unknown : old.getUnknownNodes()) {
- copy.addUnknownSchemaNode(unknown);
- }
- copy.setDescription(old.getDescription());
- copy.setReference(old.getReference());
- copy.setStatus(old.getStatus());
- copy.setAugmenting(old.isAugmenting());
- copy.setConfiguration(old.isConfiguration());
- copy.setDefaultStr(old.getDefaultStr());
- copy.setUnits(old.getUnits());
- return copy;
- }
-
- public static ContainerSchemaNodeBuilder copyContainerBuilder(
- final ContainerSchemaNodeBuilder old) {
- final ContainerSchemaNodeBuilder copy = new ContainerSchemaNodeBuilder(
- old.getQName(), old.getLine());
- copy.setPath(old.getPath());
- copyConstraints(old, copy);
- for (UnknownSchemaNodeBuilder unknown : old.getUnknownNodes()) {
- copy.addUnknownSchemaNode(unknown);
- }
- for (DataSchemaNodeBuilder child : old.getChildNodes()) {
- copy.addChildNode(child);
- }
- for (GroupingBuilder grouping : old.getGroupings()) {
- copy.addGrouping(grouping);
- }
- for (TypeDefinitionBuilder typedef : old.getTypeDefinitions()) {
- copy.addTypedef(typedef);
- }
- for (AugmentationSchemaBuilder augment : old.getAugmentations()) {
- copy.addAugmentation(augment);
- }
- for (UsesNodeBuilder use : old.getUsesNodes()) {
- copy.addUsesNode(use);
- }
- copy.setDescription(old.getDescription());
- copy.setReference(old.getReference());
- copy.setStatus(old.getStatus());
- copy.setAugmenting(old.isAugmenting());
- copy.setConfiguration(old.isConfiguration());
- copy.setPresence(old.isPresence());
- return copy;
- }
-
- public static ListSchemaNodeBuilder copyListBuilder(
- final ListSchemaNodeBuilder old) {
- final ListSchemaNodeBuilder copy = new ListSchemaNodeBuilder(
- old.getQName(), old.getLine());
- copy.setPath(old.getPath());
- copyConstraints(old, copy);
- for (UnknownSchemaNodeBuilder unknown : old.getUnknownNodes()) {
- copy.addUnknownSchemaNode(unknown);
- }
- for (DataSchemaNodeBuilder child : old.getChildNodes()) {
- copy.addChildNode(child);
- }
- for (GroupingBuilder grouping : old.getGroupings()) {
- copy.addGrouping(grouping);
- }
- for (TypeDefinitionBuilder typedef : old.getTypeDefinitions()) {
- copy.addTypedef(typedef);
- }
- for (AugmentationSchemaBuilder augment : old.getAugmentations()) {
- copy.addAugmentation(augment);
- }
- for (UsesNodeBuilder use : old.getUsesNodes()) {
- copy.addUsesNode(use);
- }
- copy.setDescription(old.getDescription());
- copy.setReference(old.getReference());
- copy.setStatus(old.getStatus());
- copy.setAugmenting(old.isAugmenting());
- copy.setConfiguration(old.isConfiguration());
- copy.setUserOrdered(old.isUserOrdered());
- return copy;
- }
-
- public static LeafListSchemaNodeBuilder copyLeafListBuilder(
- final LeafListSchemaNodeBuilder old) {
- final LeafListSchemaNodeBuilder copy = new LeafListSchemaNodeBuilder(
- old.getQName(), old.getLine());
- copy.setPath(old.getPath());
- copyConstraints(old, copy);
- final TypeDefinition<?> type = old.getType();
- if (type == null) {
- copy.setTypedef(old.getTypedef());
- } else {
- copy.setType(type);
- }
- for (UnknownSchemaNodeBuilder unknown : old.getUnknownNodes()) {
- copy.addUnknownSchemaNode(unknown);
- }
- copy.setDescription(old.getDescription());
- copy.setReference(old.getReference());
- copy.setStatus(old.getStatus());
- copy.setAugmenting(old.isAugmenting());
- copy.setConfiguration(old.isConfiguration());
- copy.setUserOrdered(old.isUserOrdered());
- return copy;
- }
-
- public static ChoiceBuilder copyChoiceBuilder(final ChoiceBuilder old) {
- final ChoiceBuilder copy = new ChoiceBuilder(old.getQName(),
- old.getLine());
- copy.setPath(old.getPath());
- copyConstraints(old, copy);
- for (ChoiceCaseBuilder caseBuilder : old.getCases()) {
- copy.addChildNode(caseBuilder);
- }
- for (UnknownSchemaNodeBuilder unknown : old.getUnknownNodes()) {
- copy.addUnknownSchemaNode(unknown);
- }
- copy.setDefaultCase(old.getDefaultCase());
- copy.setDescription(old.getDescription());
- copy.setReference(old.getReference());
- copy.setStatus(old.getStatus());
- copy.setAugmenting(old.isAugmenting());
- copy.setConfiguration(old.isConfiguration());
- return copy;
- }
-
- public static AnyXmlBuilder copyAnyXmlBuilder(final AnyXmlBuilder old) {
- final AnyXmlBuilder copy = new AnyXmlBuilder(old.getQName(),
- old.getLine());
- copy.setPath(old.getPath());
- copyConstraints(old, copy);
- for (UnknownSchemaNodeBuilder unknown : old.getUnknownNodes()) {
- copy.addUnknownSchemaNode(unknown);
- }
- copy.setDescription(old.getDescription());
- copy.setReference(old.getReference());
- copy.setStatus(old.getStatus());
- copy.setConfiguration(old.isConfiguration());
- return copy;
- }
-
- public static GroupingBuilder copyGroupingBuilder(final GroupingBuilder old) {
- final GroupingBuilder copy = new GroupingBuilderImpl(old.getQName(),
- old.getLine());
- copy.setPath(old.getPath());
- for (DataSchemaNodeBuilder child : old.getChildNodes()) {
- copy.addChildNode(child);
- }
- for (GroupingBuilder grouping : old.getGroupings()) {
- copy.addGrouping(grouping);
- }
- for (TypeDefinitionBuilder typedef : old.getTypeDefinitions()) {
- copy.addTypedef(typedef);
- }
- for (UsesNodeBuilder use : old.getUses()) {
- copy.addUsesNode(use);
- }
- for (UnknownSchemaNodeBuilder unknown : old.getUnknownNodes()) {
- copy.addUnknownSchemaNode(unknown);
- }
- copy.setDescription(old.getDescription());
- copy.setReference(old.getReference());
- copy.setStatus(old.getStatus());
- return copy;
- }
-
- public static TypeDefinitionBuilderImpl copyTypedefBuilder(
- TypeDefinitionBuilderImpl old) {
- final TypeDefinitionBuilderImpl copy = new TypeDefinitionBuilderImpl(
- old.getQName(), old.getLine());
- copy.setPath(old.getPath());
- copy.setDefaultValue(old.getDefaultValue());
- copy.setUnits(old.getUnits());
- copy.setDescription(old.getDescription());
- copy.setReference(old.getReference());
- copy.setStatus(old.getStatus());
-
- copy.setRanges(old.getRanges());
- copy.setLengths(old.getLengths());
- copy.setPatterns(old.getPatterns());
- copy.setFractionDigits(old.getFractionDigits());
-
- TypeDefinition<?> type = old.getType();
- if (type == null) {
- copy.setTypedef(old.getTypedef());