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=31a385ce4b5009d91810c09190d1f7da301ecf49;hb=a96072a8cdbaaaad1a41dbe0679405cdf6432bfa;hp=1a91570b6bfc030c9a1a4c5d725321e707bed231;hpb=6dea5d7a81c51f3838750215b7aa35aa7d190d86;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 1a91570b6b..31a385ce4b 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 @@ -1,47 +1,69 @@ +/* + * 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 javax.annotation.Nonnull; import org.opendaylight.yangtools.concepts.Identifiable; import org.opendaylight.yangtools.yang.common.QName; -import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; -import org.opendaylight.yangtools.yang.data.api.Node; +import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; /** - * * Node which is normalized according to the YANG schema - * is identifiable by {@link InstanceIdentifier}. - * + * is identifiable by a {@link org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier}. * - * @author Tony Tkacik + *

+ * See subinterfaces of this interface for concretization of node. * * @param Local identifier of node * @param Value of node */ -public interface NormalizedNode extends - Identifiable, // - Node { - +/* + * FIXME: 3.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 + * handling hints and bindings. + * + * Implementations (i.e. the reference implementation and parsers) will need to start using + * yang.common.Uint8 and friends and, if possible, express data validation in terms + * of yang.common.CanonicalValue and yang.common.CanonicalValueValidator. + * + * This notably means that to efficiently implement any sort of lenient parsing, we need a separate + * 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 + * 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. + */ +public interface NormalizedNode extends Identifiable { /** - * * QName of the node as defined in YANG schema. * + * @return QName of this node, non-null. */ - @Override - public QName getNodeType(); + QName getNodeType(); /** + * Locally unique identifier of the node. * - * Locally unique identifier of nodes - * + * @return Node identifier, non-null. */ @Override - public K getIdentifier(); + @Nonnull K getIdentifier(); /** + * Value of node. * - * Value of node - * + * @return Value of the node, may be null. */ - @Override - public V getValue(); - + @Nonnull V getValue(); }