1 package org.opendaylight.yangtools.yang.parser.spi.meta;
3 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
4 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
5 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
6 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
10 * Support for processing concrete YANG statement.
12 * This interface is intended to be implemented by developers, which want to
13 * introduce support of statement to parser. Consider subclassing
14 * {@link AbstractStatementSupport} for easier implementation of this interface.
19 * Declared Statement representation
21 * Effective Statement representation
23 public interface StatementSupport<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>> extends StatementDefinition, StatementFactory<A, D, E> {
26 * Returns public statement definition, which will be present in builded statements.
28 * Public statement definition may be used to provide different implementation
29 * of statement definition, which will not retain any build specific data
32 * @return public statement definition, which will be present in builded statements.
34 StatementDefinition getPublicView();
38 * Parses textual representation of argument in object representation.
40 * @param ctx Context, which may be used to access source-specific namespaces
41 * required for parsing.
42 * @param value String representation of value, as was present in text source.
43 * @return Parsed value
45 A parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) throws SourceException;
49 * Invoked when statement is added to build context.
52 * Context of added statement. No substatement are available.
54 void onStatementAdded(StmtContext.Mutable<A, D, E> stmt);
58 * Invoked when statement is closed during
59 * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase.
61 * Invoked when statement is closed during
62 * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase, only substatements from
63 * this and previous phase are available.
65 * Implementation may use method to perform actions on this event or
66 * register modification action using
67 * {@link StmtContext.Mutable#newInferenceAction(ModelProcessingPhase)}.
70 * Context of added statement.
72 void onLinkageDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;
76 * Invoked when statement is closed during
77 * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase.
79 * Invoked when statement is closed during
80 * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase, only substatements from
81 * this phase are available.
83 * Implementation may use method to perform actions on this event or
84 * register modification action using
85 * {@link StmtContext.Mutable#newInferenceAction(ModelProcessingPhase)}.
88 * Context of added statement. Argument and statement parent is
91 void onStatementDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;
95 * Invoked when statement is closed during
96 * {@link ModelProcessingPhase#FULL_DECLARATION} phase.
98 * Invoked when statement is closed during
99 * {@link ModelProcessingPhase#FULL_DECLARATION} phase, only substatements
100 * from this phase are available.
102 * Implementation may use method to perform actions on this event or
103 * register modification action using
104 * {@link StmtContext.Mutable#newInferenceAction(ModelProcessingPhase)}.
108 * Context of added statement. Argument and statement parent is
111 void onFullDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws SourceException;