Deprecate schema-aware builders
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / builder / impl / ImmutableAnyXmlNodeSchemaAwareBuilder.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.data.impl.schema.builder.impl;
9
10 import javax.xml.transform.dom.DOMSource;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
13 import org.opendaylight.yangtools.yang.data.api.schema.DOMSourceAnyxmlNode;
14 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeBuilder;
15 import org.opendaylight.yangtools.yang.model.api.AnyxmlSchemaNode;
16
17 @Deprecated(since = "6.0.7", forRemoval = true)
18 public final class ImmutableAnyXmlNodeSchemaAwareBuilder extends ImmutableAnyXmlNodeBuilder {
19     private ImmutableAnyXmlNodeSchemaAwareBuilder(final AnyxmlSchemaNode schema) {
20         super.withNodeIdentifier(NodeIdentifier.create(schema.getQName()));
21     }
22
23     public static @NonNull NormalizedNodeBuilder<NodeIdentifier, DOMSource, DOMSourceAnyxmlNode> create(
24             final AnyxmlSchemaNode schema) {
25         return new ImmutableAnyXmlNodeSchemaAwareBuilder(schema);
26     }
27
28     @Override
29     public NormalizedNodeBuilder<NodeIdentifier, DOMSource, DOMSourceAnyxmlNode> withValue(final DOMSource withValue) {
30         return super.withValue(withValue);
31     }
32
33     @Override
34     public NormalizedNodeBuilder<NodeIdentifier, DOMSource, DOMSourceAnyxmlNode> withNodeIdentifier(
35             final NodeIdentifier withNodeIdentifier) {
36         throw new UnsupportedOperationException("Node identifier created from schema");
37     }
38 }