abstract class AbstractImportStatementSupport
extends BaseStringStatementSupport<ImportStatement, ImportEffectiveStatement> {
AbstractImportStatementSupport() {
- super(YangStmtMapping.IMPORT);
+ super(YangStmtMapping.IMPORT, CopyPolicy.REJECT);
}
@Override
moduleName);
Verify.verifyNotNull(importedModuleNamespace);
final String impPrefix = SourceException.throwIfNull(
- firstAttributeOf(stmt.declaredSubstatements(), PrefixStatement.class), stmt.sourceReference(),
+ firstAttributeOf(stmt.declaredSubstatements(), PrefixStatement.class), stmt,
"Missing prefix statement");
stmt.addToNs(ImpPrefixToNamespace.class, impPrefix, importedModuleNamespace);
@Override
public void prerequisiteFailed(final Collection<? extends Prerequisite<?>> failed) {
- InferenceException.throwIf(failed.contains(imported), stmt.sourceReference(),
- "Imported module [%s] was not found.", moduleName);
+ InferenceException.throwIf(failed.contains(imported), stmt, "Imported module [%s] was not found.",
+ moduleName);
}
});
}
final String moduleName, final String prefix) {
// When 'revision-date' of an import is not specified in yang source, we need to find revision of imported
// module.
- final QNameModule importedModule = StmtContextUtils.getModuleQNameByPrefix(ctx, prefix);
- SourceException.throwIfNull(importedModule, ctx.sourceReference(),
- "Unable to find import of module %s with prefix %s.", moduleName, prefix);
+ final QNameModule importedModule = SourceException.throwIfNull(
+ StmtContextUtils.getModuleQNameByPrefix(ctx, prefix), ctx,
+ "Unable to find import of module %s with prefix %s.", moduleName, prefix);
return importedModule.getRevision().orElse(null);
}
}