Merge "Execute yang-maven-plugin"
[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.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode;
13 import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.NormalizedNodeAttrBuilder;
14 import org.opendaylight.yangtools.yang.model.api.AnyXmlSchemaNode;
15
16 public final class ImmutableAnyXmlNodeSchemaAwareBuilder extends ImmutableAnyXmlNodeBuilder {
17
18     private ImmutableAnyXmlNodeSchemaAwareBuilder(AnyXmlSchemaNode schema) {
19         super.withNodeIdentifier(new YangInstanceIdentifier.NodeIdentifier(schema.getQName()));
20     }
21
22     public static NormalizedNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, DOMSource, AnyXmlNode> create(AnyXmlSchemaNode schema) {
23         return new ImmutableAnyXmlNodeSchemaAwareBuilder(schema);
24     }
25
26     @Override
27     public NormalizedNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, DOMSource, AnyXmlNode> withValue(DOMSource value) {
28         return super.withValue(value);
29     }
30
31     @Override
32     public NormalizedNodeAttrBuilder<YangInstanceIdentifier.NodeIdentifier, DOMSource, AnyXmlNode> withNodeIdentifier(YangInstanceIdentifier.NodeIdentifier nodeIdentifier) {
33         throw new UnsupportedOperationException("Node identifier created from schema");
34     }
35 }