/*
 * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.yangtools.yang.data.api.schema;

import org.opendaylight.yangtools.yang.data.api.AttributesContainer;
import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.NodeIdentifier;
import org.opendaylight.yangtools.yang.data.api.Node;

/**
 * Anyxml normalizedNode.
 *
 * <p>
 * This node contains values for anyxml as either SimpleNode or CompositeNode.
 * The concrete value depends on the current value of anyxml node.
 * </p>
 *
 * <p>
 * For yang node: anyxml foo;
 *
 * <ul>
 * <li>
 * with xml value:
 * <pre>
 * {@code <foo>justSomeString</foo>}
 * </pre>
 * </li>
 *
 * this AnyXmlNode returns SimpleNode with QName{namespace=someNamespace, revision=someRevision, localName=foo} and value="justSomeString"
 *
 * <li>
 * but with xml value:
 * <pre>
 * {@code <foo><bar>stringInXml</bar></foo>}
 * </pre>
 * </li>
 *
 * this AnyXmlNode returns CompositeNode with QName{}namespace=someNamespace, revision=someRevision, localName=foo}
 * and values [SimpleNode with QName{}namespace=someNamespace, revision=someRevision, localName=bar} and value="stringInXml"]
 * </ul>
 * </p>
 */
public interface AnyXmlNode extends AttributesContainer, DataContainerChild<NodeIdentifier, Node<?>> {

    @Override
    NodeIdentifier getIdentifier();

    /**
     * @return anyxml node value represented as SimpleNode or CompositeNode.
     * Returned node contains top level element that duplicates the anyxml node.
     */
    @Override
    Node<?> getValue();
}

Add Anyxml normalized node to yang-data-api.
Add Anyxml normalized node to yang-data-api.

Proposal of anyxml normalized node interface.
This interface wraps Simple/CompositeNode as inner value.

Change-Id: Ic9c17fa28bc5eb23288162a735d890b4f77938f1
Signed-off-by: Maros Marsalek <a544a3532fb445ec334131e35bc3fd119321dec7@cisco.com>
Signed-off-by: Jozef Gloncak <93ae3d3993b13ba68c9ddb2c57b69b85d87b713a@cisco.com>
