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 InferenceException,
77 * Invoked when statement is closed during
78 * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase.
80 * Invoked when statement is closed during
81 * {@link ModelProcessingPhase#STATEMENT_DEFINITION} phase, only substatements from
82 * this phase are available.
84 * Implementation may use method to perform actions on this event or
85 * register modification action using
86 * {@link StmtContext.Mutable#newInferenceAction(ModelProcessingPhase)}.
89 * Context of added statement. Argument and statement parent is
92 void onStatementDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws InferenceException,
97 * Invoked when statement is closed during
98 * {@link ModelProcessingPhase#FULL_DECLARATION} phase.
100 * Invoked when statement is closed during
101 * {@link ModelProcessingPhase#FULL_DECLARATION} phase, only substatements
102 * from this phase are available.
104 * Implementation may use method to perform actions on this event or
105 * register modification action using
106 * {@link StmtContext.Mutable#newInferenceAction(ModelProcessingPhase)}.
110 * Context of added statement. Argument and statement parent is
113 void onFullDefinitionDeclared(StmtContext.Mutable<A, D, E> stmt) throws InferenceException,