import java.util.Collection;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+
/**
* Represents declared statement
*
public interface DeclaredStatement<A> extends ModelStatement<A> {
/**
- *
* Returns statement argument as was present in original source.
*
* @return statement argument as was present in original source or null, if statement does not take argument.
@Nullable String rawArgument();
/**
- *
* Returns collection of explicitly declared child statements, while preserving its original
* ordering from original source.
*
* source of model.
*/
@Nonnull Collection<? extends DeclaredStatement<?>> declaredSubstatements();
-
}
S getDeclared();
/**
- *
* Returns value associated with supplied identifier
*
* @param <K>
* @param identifier
* Identifier of element.
* @return Value if present, null otherwise.
- *
- *
*/
//<K, V, N extends IdentifierNamespace<? super K, ? extends V>> V
@Nullable
<K,V,N extends IdentifierNamespace<K, V>> V get(@Nonnull Class<N> namespace,@Nonnull K identifier);
/**
- *
* Returns all local values from supplied namespace.
*
* @param <K>
<K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAll(@Nonnull Class<N> namespace);
/**
+ * Returns a collection of all effective substatements.
*
- * Returns iteration of all effective substatements.
- *
- * @return iteration of all effective substatements.
+ * @return collection of all effective substatements.
*/
- Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements();
-
+ @Nonnull Collection<? extends EffectiveStatement<?, ?>> effectiveSubstatements();
}
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
+
/**
- *
* Model specific namespace which allows access to specific
*
* {@link IdentifierNamespace} serves as common superclass for YANG model
* @param <V> Value type
*/
public interface IdentifierNamespace<K,V> {
-
/**
- *
* Returns value associated with supplied identifier
*
* @param identifier Identifier of value
* @return value or null, if identifier is not present in namespace.
*/
@Nullable V get(@Nonnull K identifier);
-
}
import javax.annotation.Nullable;
/**
- *
* Model statement
*
* There are two base types of model statements:
* @param <A> Argument type ({@link Void} if statement does not have argument.)
*/
public interface ModelStatement<A> {
-
/**
* Statement Definition of this statement.
*
@Nonnull StatementDefinition statementDefinition();
/**
- *
* Returns statement argument
*
* @return statement argument or null if statement does not have argument.
* @return statement source.
*/
@Nonnull StatementSource getStatementSource();
-
}
import org.opendaylight.yangtools.yang.common.QName;
/**
- *
* Definition / model of YANG {@link DeclaredStatement} and {@link EffectiveStatement}.
*
* Statement concept is defined in RFC6020 section 6.3:
* </blockquote>
*
* Source: <a href="https://tools.ietf.org/html/rfc6020#section-6.3"> </a>
- *
- *
*/
public interface StatementDefinition extends Immutable {
-
/**
- *
* Returns name of the statement
*
* @return Name of the statement
QName getStatementName();
/**
- *
* Returns name of statement argument or null, if statement does not have
* argument.
*
QName getArgumentName();
/**
- *
* Returns class which represents declared version of statement associated
* with this definition.
*
Class<? extends DeclaredStatement<?>> getDeclaredRepresentationClass();
/**
- *
* Returns class which represents derived behaviour from supplied statement.
*
* This class should be interface, which defines convenience access to
*/
@Nonnull
Class<? extends EffectiveStatement<?,?>> getEffectiveRepresentationClass();
-
}
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
package org.opendaylight.yangtools.yang.model.api.meta;
+
/**
- *
* Origin of statement
*
* Represents origin of statement - if it was explicitly present
* in model representation or if it was inferred from context.
- *
*/
public enum StatementSource {
/**
- *
* Statement was explicitly declared by author
* of the supplied model.
- *
*/
DECLARATION,
+
/**
- *
* Statement was derived from context of YANG model / statement
* and represents effective model.
*
* Effective context nodes are derived from applicable {@link #DECLARATION}
* statements by interpreting their semantic meaning in context
* of current statement.
- *
*/
CONTEXT
-
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
+
/**
* Meta model of YANG model as was defined in RFC6020 and extracted by analysis
* of YANG text.