class DBDocTask extends BaseLiquibaseTask {
    private FileResource outputDirectory;
    private String changeLog;
    private String contexts;

    @Override
    public void executeWithLiquibaseClassloader() throws BuildException {<FILL_FUNCTION_BODY>}

    @Override
    protected void validateParameters() {
        super.validateParameters();

        if(changeLog == null) {
            throw new BuildException("Change log is required.");
        }
        if(outputDirectory == null) {
            throw new BuildException("Output directory is required.");
        }
    }

    @Override
    protected String getChangeLogFile() {
        return changeLog;
    }

    public void setChangeLogFile(String changeLog) {
        this.changeLog = changeLog;
    }

    public FileResource getOutputDirectory() {
        return outputDirectory;
    }

    public void setOutputDirectory(FileResource outputDirectory) {
        this.outputDirectory = outputDirectory;
    }

    public void setContexts(String contexts) {
        this.contexts = contexts;
    }
}

        File outputDirFile = outputDirectory.getFile();
        if(!outputDirFile.exists()) {
            boolean success = outputDirFile.mkdirs();
            if(!success) {
                throw new BuildException("Unable to create output directory.");
            }
        }
        if(!outputDirFile.isDirectory()) {
            throw new BuildException("Output path is not a directory.");
        }

        Liquibase liquibase = getLiquibase();
        try {
            if (contexts != null) {
                liquibase.generateDocumentation(outputDirectory.toString(), contexts);
            } else {
                liquibase.generateDocumentation(outputDirectory.toString());
            }
        } catch (LiquibaseException e) {
            throw new BuildException("Liquibase encountered an error while creating database documentation. " + e, e);
        }
    
<methods>public void <init>() ,public void addChangeLogParameters(liquibase.integration.ant.type.ChangeLogParametersType) ,public void addDatabase(liquibase.integration.ant.type.DatabaseType) ,public Path createClasspath() ,public final void execute() throws BuildException,public java.lang.String getChangeLogDirectory() ,public java.lang.String getSearchPath() ,public void init() throws BuildException,public boolean isPromptOnNonLocalDatabase() ,public void setChangeLogParametersRef(Reference) ,public void setClasspathRef(Reference) ,public void setDatabaseRef(Reference) ,public void setPromptOnNonLocalDatabase(boolean) <variables>private liquibase.integration.ant.type.ChangeLogParametersType changeLogParameters,private AntClassLoader classLoader,private Path classpath,private static final java.util.ResourceBundle coreBundle,private liquibase.integration.ant.type.DatabaseType databaseType,private liquibase.Liquibase liquibase,private liquibase.resource.ResourceAccessor resourceAccessor,private final Map<java.lang.String,java.lang.Object> scopeValues