2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.data.api.schema;
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.concepts.Identifiable;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
16 * Node which is normalized according to the YANG schema
17 * is identifiable by a {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier}.
20 * See subinterfaces of this interface for concretization of node.
22 * @param <K> Local identifier of node
23 * @param <V> Value of node
26 * FIXME: 7.0.0: NormalizedNode represents the perfectly-compliant view of the data, as evaluated by an implementation,
27 * which is currently singular, with respect of its interpretation of a SchemaContext. This includes
28 * leaf values, which are required to hold normalized representation for a particular implementation,
29 * which may be affected by its understanding of any YANG extensions present -- such as optional type
30 * handling hints and bindings.
32 * Implementations (i.e. the reference implementation and parsers) will need to start using
33 * yang.common.Uint8 and friends and, if possible, express data validation in terms
34 * of yang.common.CanonicalValue and yang.common.CanonicalValueValidator.
36 * This notably means that to efficiently implement any sort of lenient parsing, we need a separate
37 * concept which contains an unverified, potentially non-conformant data tree, which the consumer needs
38 * to check/fixup if it wishes to use it as a NormalizedNode. Such a concept should be called
41 * FIXME: 7.0.0: Once we have UnverifiedData, we should really rename this to "NormalizedData" or similar to unload
42 * some "Node" ambiguity. "Node" should be a generic term reserved for a particular domain -- hence 'node'
43 * can be used to refer to either a 'schema node' in context of yang.model.api, or to
44 * a 'normalized data node' in context of yang.data.api.
46 * FIXME: 7.0.0: Well, not quite. The structure of unverified data is really codec specific -- and JSON and XML
47 * do not agree on details. Furthermore things get way more complicated when we have a cross-schema
48 * boundary -- like RFC8528. Hence we cannot really have a reasonably-structured concept of unverified
49 * data. Nevertheless, this interface should be named 'NormalizedData'.
51 * FIXME: YANGTOOLS-1074: eliminate Identifiable<K> and K type argument
52 * FIXME: YANGTOOLS-1074: eliminate V type argument
54 public interface NormalizedNode<K extends PathArgument, V> extends Identifiable<K> {
56 * QName of the node as defined in YANG schema.
58 * @return QName of this node, non-null.
60 // FIXME: YANGTOOLS-1074: eliminate this method
64 * Locally unique identifier of the node.
66 * @return Node identifier, non-null.
74 * @return Value of the node, may be null.
76 // FIXME: YANGTOOLS-1074: eliminate this method
77 @NonNull V getValue();