*/
package org.opendaylight.yangtools.yang.parser.spi.meta;
-import com.google.common.base.Optional;
import java.util.Collection;
import java.util.Map;
+import java.util.Optional;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.opendaylight.yangtools.yang.common.QNameModule;
StatementDefinition getPublicDefinition();
/**
- * @return context of parent of statement
+ * Return the parent statement context, or null if this is the root statement.
+ *
+ * @return context of parent of statement, or null if this is the root statement.
*/
@Nullable
StmtContext<?, ?, ?> getParentContext();
/**
* Return the {@link SchemaPath} of this statement. Not all statements have a SchemaPath, in which case
- * {@link Optional#absent()} is returned.
+ * {@link Optional#empty()} is returned.
*
* @return Optional SchemaPath
*/
Collection<? extends StmtContext<?, ?, ?>> getEffectOfStatement();
- StatementContextBase<A, D, E> createCopy(StatementContextBase<?, ?, ?> newParent, CopyType typeOfCopy);
+ /**
+ * @return copy of this considering {@link CopyType} (augment, uses)
+ *
+ * @throws org.opendaylight.yangtools.yang.parser.spi.source.SourceException instance of SourceException
+ */
+ Mutable<A, D, E> createCopy(StatementContextBase<?, ?, ?> newParent, CopyType typeOfCopy);
- StatementContextBase<A, D, E> createCopy(QNameModule newQNameModule, StatementContextBase<?, ?, ?> newParent,
+ /**
+ * @return copy of this considering {@link CopyType} (augment, uses)
+ *
+ * @throws org.opendaylight.yangtools.yang.parser.spi.source.SourceException instance of SourceException
+ */
+ Mutable<A, D, E> createCopy(QNameModule newQNameModule, StatementContextBase<?, ?, ?> newParent,
CopyType typeOfCopy);
CopyHistory getCopyHistory();
boolean isSupportedByFeatures();
- StmtContext<?, ?, ?> getOriginalCtx();
-
- boolean isRootContext();
-
- int getOrder();
+ Optional<StmtContext<?, ?, ?>> getOriginalCtx();
ModelProcessingPhase getCompletedPhase();
extends StmtContext<A, D, E> {
@Override
- StmtContext.Mutable<?, ?, ?> getParentContext();
+ Mutable<?, ?, ?> getParentContext();
- <K, V, KT extends K, VT extends V, N extends IdentifierNamespace<K, V>> void addToNs(
- Class<N> type, KT key, VT value)
- throws NamespaceNotAvailableException;
+ <K, V, KT extends K, VT extends V, N extends IdentifierNamespace<K, V>> void addToNs(Class<N> type, KT key,
+ VT value) throws NamespaceNotAvailableException;
@Nonnull
@Override
- StmtContext.Mutable<?, ?, ?> getRoot();
+ Mutable<?, ?, ?> getRoot();
- @Override
@Nonnull
- Collection<StatementContextBase<?, ?, ?>> declaredSubstatements();
+ Collection<? extends Mutable<?, ?, ?>> mutableDeclaredSubstatements();
- @Override
@Nonnull
- Collection<StatementContextBase<?, ?, ?>> effectiveSubstatements();
+ Collection<? extends Mutable<?, ?, ?>> mutableEffectiveSubstatements();
/**
* Create a new inference action to be executed during specified phase. The action cannot be cancelled
* @param stmt
* to be added to namespace map
*/
- <K, KT extends K, N extends StatementNamespace<K, ?, ?>> void addContext(
- Class<N> namespace, KT key, StmtContext<?, ?, ?> stmt);
+ <K, KT extends K, N extends StatementNamespace<K, ?, ?>> void addContext(Class<N> namespace, KT key,
+ StmtContext<?, ?, ?> stmt);
/**
* Set version of root statement context.
void setIsSupportedToBuildEffective(boolean isSupportedToBuild);
- void appendCopyHistory(CopyType typeOfCopy, CopyHistory toAppend);
-
- void setOriginalCtx(StmtContext<?, ?, ?> originalCtx);
-
- void setOrder(int order);
-
// FIXME: this seems to be unused, but looks useful.
void setCompletedPhase(ModelProcessingPhase completedPhase);
}