X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-data-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fdata%2Fapi%2Fschema%2FNormalizedNode.java;h=da1ed92067989dd2da81d9bd60e2952c0c175cd4;hb=1e8209bb1e52b827e0e1e783a9c11cb6b8241d12;hp=31a385ce4b5009d91810c09190d1f7da301ecf49;hpb=968b41a1c1f7f9f435248015926cdaa063b277f5;p=yangtools.git
diff --git a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNode.java b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNode.java
index 31a385ce4b..da1ed92067 100644
--- a/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNode.java
+++ b/yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/NormalizedNode.java
@@ -7,9 +7,8 @@
*/
package org.opendaylight.yangtools.yang.data.api.schema;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.Identifiable;
-import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
/**
@@ -18,12 +17,9 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
*
*
* See subinterfaces of this interface for concretization of node.
- *
- * @param Local identifier of node
- * @param Value of node
*/
/*
- * FIXME: 3.0.0: NormalizedNode represents the perfectly-compliant view of the data, as evaluated by an implementation,
+ * FIXME: 8.0.0: NormalizedNode represents the perfectly-compliant view of the data, as evaluated by an implementation,
* which is currently singular, with respect of its interpretation of a SchemaContext. This includes
* leaf values, which are required to hold normalized representation for a particular implementation,
* which may be affected by its understanding of any YANG extensions present -- such as optional type
@@ -37,33 +33,28 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
* concept which contains an unverified, potentially non-conformant data tree, which the consumer needs
* to check/fixup if it wishes to use it as a NormalizedNode. Such a concept should be called
* "UnverifiedData".
- */
-/*
- * FIXME: 4.0.0: Once we have UnverifiedData, we should really rename this to "NormalizedData" or similar to unload
+ *
+ * FIXME: 8.0.0: Once we have UnverifiedData, we should really rename this to "NormalizedData" or similar to unload
* some "Node" ambiguity. "Node" should be a generic term reserved for a particular domain -- hence 'node'
* can be used to refer to either a 'schema node' in context of yang.model.api, or to
* a 'normalized data node' in context of yang.data.api.
+ *
+ * FIXME: 8.0.0: Well, not quite. The structure of unverified data is really codec specific -- and JSON and XML
+ * do not agree on details. Furthermore things get way more complicated when we have a cross-schema
+ * boundary -- like RFC8528. Hence we cannot really have a reasonably-structured concept of unverified
+ * data. Nevertheless, this interface should be named 'NormalizedData'.
*/
-public interface NormalizedNode extends Identifiable {
- /**
- * QName of the node as defined in YANG schema.
- *
- * @return QName of this node, non-null.
- */
- QName getNodeType();
-
- /**
- * Locally unique identifier of the node.
- *
- * @return Node identifier, non-null.
- */
+public interface NormalizedNode extends Identifiable {
@Override
- @Nonnull K getIdentifier();
+ // We override here, so that NormalizedNode.getIdentifier() has fewer implementations
+ PathArgument getIdentifier();
/**
- * Value of node.
+ * Returns the body of this node. While the return value specifies {@link Object}, this method's return value has
+ * further semantics. The returned object must be a well-published contract, such as {@code String},
+ * {@code Collection} or {@code DOMSource}.
*
- * @return Value of the node, may be null.
+ * @return Returned value of this node.
*/
- @Nonnull V getValue();
+ @NonNull Object body();
}