2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
10 import static java.util.Objects.requireNonNull;
12 import javax.xml.transform.dom.DOMSource;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
15 import org.opendaylight.yangtools.yang.data.api.schema.AbstractAnyxmlNode;
16 import org.opendaylight.yangtools.yang.data.api.schema.AnyxmlNode;
17 import org.opendaylight.yangtools.yang.data.api.schema.DOMSourceAnyxmlNode;
19 public final class ImmutableAnyXmlNodeBuilder
20 extends AbstractImmutableNormalizedNodeBuilder<NodeIdentifier, DOMSource, DOMSourceAnyxmlNode>
21 implements AnyxmlNode.Builder<DOMSource, DOMSourceAnyxmlNode> {
23 public ImmutableAnyXmlNodeBuilder withValue(final DOMSource withValue) {
24 super.withValue(withValue);
29 public DOMSourceAnyxmlNode build() {
30 return new ImmutableXmlNode(getNodeIdentifier(), getValue());
33 private static final class ImmutableXmlNode extends AbstractAnyxmlNode<DOMSource> implements DOMSourceAnyxmlNode {
34 private final @NonNull NodeIdentifier name;
35 private final @NonNull DOMSource value;
37 ImmutableXmlNode(final NodeIdentifier name, final DOMSource value) {
38 this.name = requireNonNull(name);
39 this.value = requireNonNull(value);
43 public NodeIdentifier name() {
48 protected DOMSource value() {
53 protected DOMSource wrappedValue() {