From 858a797b6235dfb7cfb3d56d197bb46e0c4dbb9d Mon Sep 17 00:00:00 2001 From: Jozef Gloncak Date: Tue, 17 Jun 2014 09:32:47 +0200 Subject: [PATCH] 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 Signed-off-by: Jozef Gloncak --- .../yang/data/api/schema/AnyXmlNode.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AnyXmlNode.java diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AnyXmlNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AnyXmlNode.java new file mode 100644 index 0000000000..6d89b60467 --- /dev/null +++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/AnyXmlNode.java @@ -0,0 +1,58 @@ +/* + * 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. + * + *

+ * This node contains values for anyxml as either SimpleNode or CompositeNode. + * The concrete value depends on the current value of anyxml node. + *

+ * + *

+ * For yang node: anyxml foo; + * + *

    + *
  • + * with xml value: + *
    + * {@code justSomeString}
    + * 
    + *
  • + * + * this AnyXmlNode returns SimpleNode with QName{namespace=someNamespace, revision=someRevision, localName=foo} and value="justSomeString" + * + *
  • + * but with xml value: + *
    + * {@code stringInXml}
    + * 
    + *
  • + * + * 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"] + *
+ *

+ */ +public interface AnyXmlNode extends AttributesContainer, DataContainerChild> { + + @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(); +} -- 2.36.6