protected abstract @Nonnull QName transform(@Nonnull QName key);
@Override
- public void leafNode(final NodeIdentifier name, final Object value) throws IOException, IllegalArgumentException {
+ public void leafNode(final NodeIdentifier name, final Object value) throws IOException {
delegate().leafNode(transform(name), value);
}
@Override
- public void startLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException {
+ public void startLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startLeafSet(transform(name), childSizeHint);
}
@Override
- public void startOrderedLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException {
+ public void startOrderedLeafSet(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startOrderedLeafSet(transform(name), childSizeHint);
}
@Override
- public void leafSetEntryNode(final QName name, final Object value) throws IOException, IllegalArgumentException {
+ public void leafSetEntryNode(final QName name, final Object value) throws IOException {
delegate().leafSetEntryNode(transform(name), value);
}
@Override
- public void startContainerNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException {
+ public void startContainerNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startContainerNode(transform(name), childSizeHint);
}
@Override
- public void startUnkeyedList(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException {
+ public void startUnkeyedList(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startUnkeyedList(transform(name), childSizeHint);
}
@Override
- public void startUnkeyedListItem(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalStateException {
+ public void startUnkeyedListItem(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startUnkeyedListItem(transform(name), childSizeHint);
}
@Override
- public void startMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException {
+ public void startMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startMapNode(transform(name), childSizeHint);
}
@Override
- public void startMapEntryNode(final NodeIdentifierWithPredicates identifier, final int childSizeHint) throws IOException,
- IllegalArgumentException {
+ public void startMapEntryNode(final NodeIdentifierWithPredicates identifier, final int childSizeHint) throws IOException {
delegate().startMapEntryNode(transform(identifier), childSizeHint);
}
@Override
- public void startOrderedMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException,
- IllegalArgumentException {
+ public void startOrderedMapNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startOrderedMapNode(transform(name), childSizeHint);
}
@Override
- public void startChoiceNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException {
+ public void startChoiceNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startChoiceNode(transform(name), childSizeHint);
}
@Override
- public void startAugmentationNode(final AugmentationIdentifier identifier) throws IOException, IllegalArgumentException {
+ public void startAugmentationNode(final AugmentationIdentifier identifier) throws IOException {
delegate().startAugmentationNode(transform(identifier));
}
@Override
- public void anyxmlNode(final NodeIdentifier name, final Object value) throws IOException, IllegalArgumentException {
+ public void anyxmlNode(final NodeIdentifier name, final Object value) throws IOException {
delegate().anyxmlNode(transform(name), value);
}
@Override
- public void startYangModeledAnyXmlNode(final NodeIdentifier name, final int childSizeHint) throws IOException, IllegalArgumentException {
+ public void startYangModeledAnyXmlNode(final NodeIdentifier name, final int childSizeHint) throws IOException {
delegate().startYangModeledAnyXmlNode(transform(name), childSizeHint);
}
@Override
- public void endNode() throws IOException, IllegalStateException {
+ public void endNode() throws IOException {
delegate().endNode();
}
import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupportBundle;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
import org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource;
import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.ValidationBundleType;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangStatementSourceImpl;
}
}
- public EffectiveModelContext build() throws SourceException, ReactorException {
+ /**
+ * @throws org.opendaylight.yangtools.yang.parser.spi.source.SourceException
+ * @throws ReactorException
+ */
+ public EffectiveModelContext build() throws ReactorException {
return context.build();
}
- public EffectiveSchemaContext buildEffective() throws SourceException, ReactorException {
+ public EffectiveSchemaContext buildEffective() throws ReactorException {
return context.buildEffective();
}
- public SchemaContext buildEffective(final Collection<ByteSource> yangByteSources) throws SourceException,
+ public SchemaContext buildEffective(final Collection<ByteSource> yangByteSources) throws
ReactorException, IOException {
for (ByteSource yangByteSource : yangByteSources) {
addSource(new YangStatementSourceImpl(yangByteSource.openStream()));
return buildEffective();
}
- public SchemaContext buildEffective(final List<InputStream> yangInputStreams) throws SourceException,
+ public SchemaContext buildEffective(final List<InputStream> yangInputStreams) throws
ReactorException {
for (InputStream yangInputStream : yangInputStreams) {
addSource(new YangStatementSourceImpl(yangInputStream));
* @deprecated This method was never used and relies on deprecated module methods.
*/
@Deprecated
- public Map<File, Module> buildEffectiveMappedToSource(final List<File> yangFiles) throws SourceException,
+ public Map<File, Module> buildEffectiveMappedToSource(final List<File> yangFiles) throws
ReactorException, FileNotFoundException {
if (yangFiles == null || yangFiles.isEmpty()) {
return Collections.emptyMap();
import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.Registry;
import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.StorageNodeType;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
/**
* root statement class for a Yang source
private final SourceSpecificContext sourceContext;
private final A argument;
- RootStatementContext(final ContextBuilder<A, D, E> builder, final SourceSpecificContext sourceContext) throws SourceException {
+ RootStatementContext(final ContextBuilder<A, D, E> builder, final SourceSpecificContext sourceContext) {
super(builder);
this.sourceContext = sourceContext;
this.argument = builder.getDefinition().parseArgumentValue(this, builder.getRawArgument());
}
- RootStatementContext(final RootStatementContext<A, D, E> original, final QNameModule newQNameModule, final TypeOfCopy typeOfCopy)
- throws SourceException {
+ RootStatementContext(final RootStatementContext<A, D, E> original, final QNameModule newQNameModule,
+ final TypeOfCopy typeOfCopy) {
super(original);
sourceContext = original.sourceContext;
*
* @param typeOfCopy
* determines whether copy is used by augmentation or uses
- * @throws SourceException
+ * @throws org.opendaylight.yangtools.yang.parser.spi.source.SourceException
*/
private void copyDeclaredStmts(final RootStatementContext<A, D, E> original, final QNameModule newQNameModule,
- final TypeOfCopy typeOfCopy) throws SourceException {
+ final TypeOfCopy typeOfCopy) {
Collection<? extends StmtContext<?, ?, ?>> originalDeclaredSubstatements = original.declaredSubstatements();
for (StmtContext<?, ?, ?> stmtContext : originalDeclaredSubstatements) {
this.addEffectiveSubstatement(stmtContext.createCopy(newQNameModule, this, typeOfCopy));
*
* @param typeOfCopy
* determines whether copy is used by augmentation or uses
- * @throws SourceException
+ * @throws org.opendaylight.yangtools.yang.parser.spi.source.SourceException
*/
private void copyEffectiveStmts(final RootStatementContext<A, D, E> original, final QNameModule newQNameModule,
- final TypeOfCopy typeOfCopy) throws SourceException {
+ final TypeOfCopy typeOfCopy) {
Collection<? extends StmtContext<?, ?, ?>> originalEffectiveSubstatements = original.effectiveSubstatements();
for (StmtContext<?, ?, ?> stmtContext : originalEffectiveSubstatements) {
this.addEffectiveSubstatement(stmtContext.createCopy(newQNameModule, this, typeOfCopy));
/**
* @return copy of this considering {@link TypeOfCopy} (augment, uses)
*
- * @throws SourceException instance of SourceException
+ * @throws org.opendaylight.yangtools.yang.parser.spi.source.SourceException instance of SourceException
*/
@Override
- public StatementContextBase<?, ?, ?> createCopy(final StatementContextBase<?, ?, ?> newParent, final TypeOfCopy typeOfCopy)
- throws SourceException {
+ public StatementContextBase<?, ?, ?> createCopy(final StatementContextBase<?, ?, ?> newParent,
+ final TypeOfCopy typeOfCopy) {
return createCopy(null, newParent, typeOfCopy);
}
/**
* @return copy of this considering {@link TypeOfCopy} (augment, uses)
*
- * @throws SourceException instance of SourceException
+ * @throws org.opendaylight.yangtools.yang.parser.spi.source.SourceException instance of SourceException
*/
@Override
public StatementContextBase<A, D, E> createCopy(final QNameModule newQNameModule,
- final StatementContextBase<?, ?, ?> newParent, final TypeOfCopy typeOfCopy) throws SourceException {
+ final StatementContextBase<?, ?, ?> newParent, final TypeOfCopy typeOfCopy) {
RootStatementContext<A, D, E> copy = new RootStatementContext<>(this, newQNameModule, typeOfCopy);
copy.addAllToCopyHistory(this.getCopyHistory());
* event listener when an item is added to model namespace
*/
interface OnNamespaceItemAdded extends EventListener {
-
- void namespaceItemAdded(StatementContextBase<?, ?, ?> context, Class<?> namespace, Object key, Object value)
- throws SourceException;
-
+ /**
+ * @throws SourceException
+ */
+ void namespaceItemAdded(StatementContextBase<?, ?, ?> context, Class<?> namespace, Object key, Object value);
}
/**
* event listener when a parsing {@link ModelProcessingPhase} is completed
*/
interface OnPhaseFinished extends EventListener {
-
- boolean phaseFinished(StatementContextBase<?, ?, ?> context, ModelProcessingPhase phase) throws SourceException;
-
+ /**
+ * @throws SourceException
+ */
+ boolean phaseFinished(StatementContextBase<?, ?, ?> context, ModelProcessingPhase phase);
}
/**
interface ContextMutation {
boolean isFinished();
-
}
private final StatementDefinitionContext<A, D, E> definition;
this.completedPhase = completedPhase;
}
- StatementContextBase(@Nonnull final ContextBuilder<A, D, E> builder) throws SourceException {
+ StatementContextBase(@Nonnull final ContextBuilder<A, D, E> builder) {
this.definition = builder.getDefinition();
this.identifier = builder.createIdentifier();
this.statementDeclSource = builder.getStamementSource();
* @throws SourceException
* when an error occured in source parsing
*/
- boolean tryToCompletePhase(final ModelProcessingPhase phase) throws SourceException {
+ boolean tryToCompletePhase(final ModelProcessingPhase phase) {
Iterator<ContextMutation> openMutations = phaseMutation.get(phase).iterator();
boolean finished = true;
while (openMutations.hasNext()) {
* @throws SourceException
* when an error occured in source parsing
*/
- private void onPhaseCompleted(final ModelProcessingPhase phase) throws SourceException {
+ private void onPhaseCompleted(final ModelProcessingPhase phase) {
completedPhase = phase;
Iterator<OnPhaseFinished> listener = phaseListeners.get(completedPhase).iterator();
while (listener.hasNext()) {
* @param ref
* @throws SourceException
*/
- void endDeclared(final StatementSourceReference ref, final ModelProcessingPhase phase) throws SourceException {
+ void endDeclared(final StatementSourceReference ref, final ModelProcessingPhase phase) {
definition().onDeclarationFinished(this, phase);
}
*
* @throws SourceException
*/
- void addPhaseCompletedListener(final ModelProcessingPhase phase, final OnPhaseFinished listener) throws SourceException {
+ void addPhaseCompletedListener(final ModelProcessingPhase phase, final OnPhaseFinished listener) {
Preconditions.checkNotNull(phase, "Statement context processing phase cannot be null at: %s",
getStatementSourceReference());
import org.opendaylight.yangtools.yang.parser.spi.meta.QNameCacheNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace;
import org.opendaylight.yangtools.yang.parser.spi.validation.ValidationBundlesNamespace.ValidationBundleType;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.GroupingUtils;
private final A argument;
private volatile SchemaPath schemaPath;
- SubstatementContext(final StatementContextBase<?, ?, ?> parent,
- final ContextBuilder<A, D, E> builder) throws SourceException {
+ SubstatementContext(final StatementContextBase<?, ?, ?> parent, final ContextBuilder<A, D, E> builder) {
super(builder);
this.parent = Preconditions.checkNotNull(parent, "Parent must not be null");
this.argument = builder.getDefinition().parseArgumentValue(this, builder.getRawArgument());
private void copyDeclaredStmts(final SubstatementContext<A, D, E> original,
- final QNameModule newQNameModule, final TypeOfCopy typeOfCopy)
- throws SourceException {
+ final QNameModule newQNameModule, final TypeOfCopy typeOfCopy) {
Collection<? extends StatementContextBase<?, ?, ?>> originalDeclaredSubstatements = original
.declaredSubstatements();
for (StatementContextBase<?, ?, ?> stmtContext : originalDeclaredSubstatements) {
}
private void copyEffectiveStmts(final SubstatementContext<A, D, E> original,
- final QNameModule newQNameModule, final TypeOfCopy typeOfCopy)
- throws SourceException {
+ final QNameModule newQNameModule, final TypeOfCopy typeOfCopy) {
Collection<? extends StatementContextBase<?, ?, ?>> originalEffectiveSubstatements = original
.effectiveSubstatements();
for (StatementContextBase<?, ?, ?> stmtContext : originalEffectiveSubstatements) {
@Override
public StatementContextBase<?, ?, ?> createCopy(
- final StatementContextBase<?, ?, ?> newParent, final TypeOfCopy typeOfCopy)
- throws SourceException {
+ final StatementContextBase<?, ?, ?> newParent, final TypeOfCopy typeOfCopy) {
return createCopy(null, newParent, typeOfCopy);
}
@Override
public StatementContextBase<A, D, E> createCopy(final QNameModule newQNameModule,
- final StatementContextBase<?, ?, ?> newParent, final TypeOfCopy typeOfCopy)
- throws SourceException {
+ final StatementContextBase<?, ?, ?> newParent, final TypeOfCopy typeOfCopy) {
SubstatementContext<A, D, E> copy = new SubstatementContext<>(this, newQNameModule, newParent, typeOfCopy);
copy.addAllToCopyHistory(this.getCopyHistory());