All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mockrunner.jdbc.StatementResultSetHandler Maven / Gradle / Ivy

package com.mockrunner.jdbc;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import com.mockrunner.mock.jdbc.MockStatement;

/**
 * Concrete handler for {@link AbstractResultSetHandler}.
 */
public class StatementResultSetHandler extends AbstractResultSetHandler
{
    private List statements;

    public StatementResultSetHandler()
    {
        statements = new ArrayList();
    }  
    
    /**
     * The Connection adds new statements with
     * this method.
     * @param statement the {@link MockStatement}
     */
    public void addStatement(MockStatement statement)
    {
        statement.setResultSetHandler(this);
        statements.add(statement);
    }
    
    /**
     * Returns a List of all statements.
     * @return the List of {@link MockStatement} objects
     */
    public List getStatements()
    {
        return Collections.unmodifiableList(statements);
    }

    /**
     * Clears the List of statements.
     */
    public void clearStatements()
    {
        statements.clear();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy