@Override
    public ValidationErrors validate(Database database) {
        ValidationErrors changeValidationErrors = new ValidationErrors();

        // Record an error if a parameter is not set, but that parameter is required by database.
        for (ChangeParameterMetaData param :
            Scope.getCurrentScope().getSingleton(ChangeFactory.class).getChangeMetaData(this).getParameters().values()) {
            if (param.isRequiredFor(database) && (param.getCurrentValue(this) == null)) {
                changeValidationErrors.addError(param.getParameterName() + " is required for " +
                    Scope.getCurrentScope().getSingleton(ChangeFactory.class).getChangeMetaData(this).getName() + " on " + database.getShortName());
            }
        }

        // We cannot proceed to the next validation if we have missing parameters
        if (changeValidationErrors.hasErrors()) {
            return changeValidationErrors;
        }

        // Record warnings if statements are unsupported on database
        if (!generateStatementsVolatile(database)) {
            String unsupportedWarning = Scope.getCurrentScope().getSingleton(ChangeFactory.class).getChangeMetaData(this).getName()
                    + " is not supported on " + database.getShortName();
            boolean sawUnsupportedError = false;

            SqlStatement[] statements = generateStatements(database);
            if (statements != null) {
                for (SqlStatement statement : statements) {
                    boolean supported = SqlGeneratorFactory.getInstance().supports(statement, database);
                    if (!supported && !sawUnsupportedError) {
                        if (!statement.skipOnUnsupported()) {
                            changeValidationErrors.addError(unsupportedWarning);
                            sawUnsupportedError = true;
                        }
                    } else {
                        changeValidationErrors.addAll(SqlGeneratorFactory.getInstance().validate(statement, database));
                    }
                }
            }
        }

        return changeValidationErrors;
    }
@Override
    public ValidationErrors validate(Database database) {
        ValidationErrors changeValidationErrors = new ValidationErrors();

        
        for (ChangeParameterMetaData param :
            Scope.getCurrentScope().getSingleton(ChangeFactory.class).getChangeMetaData(this).getParameters().values()) {
            if (param.isRequiredFor(database) && (param.getCurrentValue(this) == null)) {
                changeValidationErrors.addError(param.getParameterName() + " is required for " +
                    Scope.getCurrentScope().getSingleton(ChangeFactory.class).getChangeMetaData(this).getName() + " on " + database.getShortName());
            }
        }

        
        if (changeValidationErrors.hasErrors()) {
            return changeValidationErrors;
        }

        
        if (!generateStatementsVolatile(database)) {
            String unsupportedWarning = Scope.getCurrentScope().getSingleton(ChangeFactory.class).getChangeMetaData(this).getName()
                    + " is not supported on " + database.getShortName();
            boolean sawUnsupportedError = false;

            SqlStatement[] statements = generateStatements(database);
            if (statements != null) {
                for (SqlStatement statement : statements) {
                    boolean supported = SqlGeneratorFactory.getInstance().supports(statement, database);
                    if (!supported && !sawUnsupportedError) {
                        if (!statement.skipOnUnsupported()) {
                            changeValidationErrors.addError(unsupportedWarning);
                            sawUnsupportedError = true;
                        }
                    } else {
                        changeValidationErrors.addAll(SqlGeneratorFactory.getInstance().validate(statement, database));
                    }
                }
            }
        }

        return changeValidationErrors;
    }
@ Override public ValidationErrors validate ( Database database ) { ValidationErrors changeValidationErrors = new ValidationErrors ( ) ; // Record an error if a parameter is not set, but that parameter is required by database. for ( ChangeParameterMetaData param : Scope . getCurrentScope ( ) . getSingleton ( ChangeFactory . class ) . getChangeMetaData ( this ) . getParameters ( ) . values ( ) ) { if ( param . isRequiredFor ( database ) && ( param . getCurrentValue ( this ) == null ) ) { changeValidationErrors . addError ( param . getParameterName ( ) + " is required for " + Scope . getCurrentScope ( ) . getSingleton ( ChangeFactory . class ) . getChangeMetaData ( this ) . getName ( ) + " on " + database . getShortName ( ) ) ; } } // We cannot proceed to the next validation if we have missing parameters if ( changeValidationErrors . hasErrors ( ) ) { return changeValidationErrors ; } // Record warnings if statements are unsupported on database if ( ! generateStatementsVolatile ( database ) ) { String unsupportedWarning = Scope . getCurrentScope ( ) . getSingleton ( ChangeFactory . class ) . getChangeMetaData ( this ) . getName ( ) + " is not supported on " + database . getShortName ( ) ; boolean sawUnsupportedError = false ; SqlStatement [ ] statements = generateStatements ( database ) ; if ( statements != null ) { for ( SqlStatement statement : statements ) { boolean supported = SqlGeneratorFactory . getInstance ( ) . supports ( statement , database ) ; if ( ! supported && ! sawUnsupportedError ) { if ( ! statement . skipOnUnsupported ( ) ) { changeValidationErrors . addError ( unsupportedWarning ) ; sawUnsupportedError = true ; } } else { changeValidationErrors . addAll ( SqlGeneratorFactory . getInstance ( ) . validate ( statement , database ) ) ; } } } } return changeValidationErrors ; }
Implementation checks the ChangeParameterMetaData for declared required fields
and also delegates logic to the
{@link liquibase.sqlgenerator.SqlGenerator#validate(liquibase.statement.SqlStatement,
liquibase.database.Database, liquibase.sqlgenerator.SqlGeneratorChain)}  method on the {@link SqlStatement}
objects returned by {@link #generateStatements }.
If no or null SqlStatements are returned by generateStatements then this method returns no errors.
If there are no parameters than this method returns no errors
Implementation checks the ChangeParameterMetaData for declared required fields and also delegates logic to the {