@Override public void onFullDefinitionDeclared(final Mutable<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, EffectiveStatement<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement>> stmt) { super.onFullDefinitionDeclared(stmt); stmt.coerceParentContext().addToNs(AnyxmlSchemaLocationNamespace.class, ANYXML_SCHEMA_LOCATION, stmt); }
@Override public void onFullDefinitionDeclared(final Mutable<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, EffectiveStatement<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement>> stmt) { super.onFullDefinitionDeclared(stmt); stmt.coerceParentContext().addToNs(AnyxmlSchemaLocationNamespace.class, ANYXML_SCHEMA_LOCATION, stmt); }
@Override public final void onFullDefinitionDeclared(final Mutable<String, IdentityRefSpecification, EffectiveStatement<String, IdentityRefSpecification>> stmt) { super.onFullDefinitionDeclared(stmt); final Collection<StmtContext<QName, BaseStatement, ?>> baseStatements = StmtContextUtils.findAllDeclaredSubstatements(stmt, BaseStatement.class); for (StmtContext<QName, BaseStatement, ?> baseStmt : baseStatements) { final QName baseIdentity = baseStmt.coerceStatementArgument(); final StmtContext<?, ?, ?> stmtCtx = stmt.getFromNamespace(IdentityNamespace.class, baseIdentity); InferenceException.throwIfNull(stmtCtx, stmt.getStatementSourceReference(), "Referenced base identity '%s' doesn't exist in given scope (module, imported modules, submodules)", baseIdentity.getLocalName()); } } }
@Override public final void onFullDefinitionDeclared( final Mutable<String, TypeStatement, EffectiveStatement<String, TypeStatement>> stmt) { super.onFullDefinitionDeclared(stmt); // if it is yang built-in type, no prerequisite is needed, so simply return if (BUILT_IN_TYPES.containsKey(stmt.getStatementArgument())) { return; } final QName typeQName = StmtContextUtils.parseNodeIdentifier(stmt, stmt.getStatementArgument()); final ModelActionBuilder typeAction = stmt.newInferenceAction(ModelProcessingPhase.EFFECTIVE_MODEL); final Prerequisite<StmtContext<?, ?, ?>> typePrereq = typeAction.requiresCtx(stmt, TypeNamespace.class, typeQName, ModelProcessingPhase.EFFECTIVE_MODEL); typeAction.mutatesEffectiveCtx(stmt.getParentContext()); /* * If the type does not exist, throw new InferenceException. * Otherwise perform no operation. */ typeAction.apply(new InferenceAction() { @Override public void apply(final InferenceContext ctx) { // Intentional NOOP } @Override public void prerequisiteFailed(final Collection<? extends Prerequisite<?>> failed) { InferenceException.throwIf(failed.contains(typePrereq), stmt.getStatementSourceReference(), "Type [%s] was not found.", typeQName); } }); }
super.onFullDefinitionDeclared(augmentNode);