import static org.opendaylight.yangtools.odlext.model.api.OpenDaylightExtensionsStatements.ANYXML_SCHEMA_LOCATION;
+import com.google.common.collect.ImmutableList;
+import org.opendaylight.yangtools.odlext.model.api.AnyxmlSchemaLocationEffectiveStatement;
import org.opendaylight.yangtools.odlext.model.api.AnyxmlSchemaLocationStatement;
+import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.ArgumentUtils;
-import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
+import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.BaseStatementSupport;
+import org.opendaylight.yangtools.yang.parser.spi.meta.EffectiveStmtCtx.Current;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
import org.opendaylight.yangtools.yang.parser.spi.meta.SubstatementValidator;
public final class AnyxmlSchemaLocationStatementSupport
- extends AbstractStatementSupport<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
- EffectiveStatement<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement>> {
+ extends BaseStatementSupport<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
+ AnyxmlSchemaLocationEffectiveStatement> {
private static final AnyxmlSchemaLocationStatementSupport INSTANCE =
new AnyxmlSchemaLocationStatementSupport(ANYXML_SCHEMA_LOCATION);
@Override
public void onFullDefinitionDeclared(final Mutable<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
- EffectiveStatement<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement>> stmt) {
+ AnyxmlSchemaLocationEffectiveStatement> stmt) {
super.onFullDefinitionDeclared(stmt);
- stmt.getParentContext().addToNs(AnyxmlSchemaLocationNamespace.class, ANYXML_SCHEMA_LOCATION, stmt);
+ stmt.coerceParentContext().addToNs(AnyxmlSchemaLocationNamespace.class, ANYXML_SCHEMA_LOCATION, stmt);
}
@Override
- public AnyxmlSchemaLocationStatement createDeclared(
- final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, ?> ctx) {
- return new AnyxmlSchemaLocationStatementImpl(ctx);
+ protected SubstatementValidator getSubstatementValidator() {
+ return validator;
}
@Override
- public EffectiveStatement<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement> createEffective(
- final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
- EffectiveStatement<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement>> ctx) {
- return new AnyxmlSchemaLocationEffectiveStatementImpl(ctx);
+ protected AnyxmlSchemaLocationStatement createDeclared(
+ final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, ?> ctx,
+ final ImmutableList<? extends DeclaredStatement<?>> substatements) {
+ return new AnyxmlSchemaLocationStatementImpl(ctx.coerceRawStatementArgument(), ctx.coerceStatementArgument(),
+ substatements);
}
@Override
- protected SubstatementValidator getSubstatementValidator() {
- return validator;
+ protected AnyxmlSchemaLocationStatement createEmptyDeclared(
+ final StmtContext<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, ?> ctx) {
+ return createDeclared(ctx, ImmutableList.of());
+ }
+
+ @Override
+ protected AnyxmlSchemaLocationEffectiveStatement createEffective(
+ final Current<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement> stmt,
+ final ImmutableList<? extends EffectiveStatement<?, ?>> substatements) {
+ return new AnyxmlSchemaLocationEffectiveStatementImpl(stmt, substatements);
}
}
\ No newline at end of file