- 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);
- }
- });
- }
-
- @Override
- protected final SubstatementValidator getSubstatementValidator() {
- return SUBSTATEMENT_VALIDATOR;
- }
-
- @Override
- public final String internArgument(final String rawArgument) {
- final String found;
- return (found = BUILT_IN_TYPES.get(rawArgument)) != null ? found : rawArgument;
- }
-
- @Override
- public boolean hasArgumentSpecificSupports() {
- return !ARGUMENT_SPECIFIC_SUPPORTS.isEmpty();
- }
-
- @Override
- public StatementSupport<?, ?, ?> getSupportSpecificForArgument(final String argument) {
- return ARGUMENT_SPECIFIC_SUPPORTS.get(argument);
+ protected final EffectiveStatement<String, TypeStatement> createEmptyEffective(
+ final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
+ final TypeStatement declared) {
+ return resolveType(ctx);