001    /*
002    This project provide access to non public fields
003    and methods as help for writing tests.
004    Copyright (C) 2007  Christof Lehmann
005    
006    This program is free software; you can redistribute it and/or
007    modify it under the terms of the GNU General Public License
008    as published by the Free Software Foundation; either version 2
009    of the License, or (at your option) any later version.
010    
011    This program is distributed in the hope that it will be useful,
012    but WITHOUT ANY WARRANTY; without even the implied warranty of
013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014    GNU General Public License for more details.
015    
016    You should have received a copy of the GNU General Public License
017    along with this program; if not, write to the Free Software
018    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019     */
020    package net.sf.testextensions;
021    
022    /**
023     * The <code>AccessMethod</code> describes the interface, for accessing a
024     * Method.
025     *
026     * @author forge-cl
027     *
028     */
029    public interface AccessMethod {
030    
031            /**
032             * The method <code>call</code> the definied methods with the spezified
033             * arguments.
034             *
035             * @param args
036             *            the args for the method call.
037             * @return the return value of the method call
038             * @throws TestExtensionException
039             *             if no method, which suites to the args, was found or any
040             *             other error occures.
041             */
042            Object call(final Object[] args) throws TestExtensionException;
043    
044            /**
045             * The method <code>call</code> the definied methods with no arguments.
046             *
047             * @return the return value of the method call
048             * @throws TestExtensionException
049             *             if no method, which suites to the args, was found or any
050             *             other error occures.
051             */
052            Object call() throws TestExtensionException;
053    
054            /**
055             * The method <code>call</code> the definied methods with the spezified
056             * arguments.
057             *
058             * @param arg
059             *            one parameter for the method call.
060             * @return the return value of the method call
061             * @throws TestExtensionException
062             *             if no method, which suites to the args, was found or any
063             *             other error occures.
064             */
065            Object call(final Object arg) throws TestExtensionException;
066    
067            /**
068             * The method <code>call</code> the definied methods with the spezified
069             * arguments.
070             *
071             * @param arg1
072             *            first parameter for the method call.
073             * @param arg2
074             *            second parameter for the method call.
075             * @return the return value of the method call
076             * @throws TestExtensionException
077             *             if no method, which suites to the args, was found or any
078             *             other error occures.
079             */
080            Object call(final Object arg1, final Object arg2)
081                            throws TestExtensionException;
082    
083            /**
084             * The method <code>call</code> the definied methods with the spezified
085             * arguments.
086             * @param arg1
087             *            first parameter for the method call.
088             * @param arg2
089             *            second parameter for the method call.
090             * @param arg3
091             *            third parameter for the method call.
092             *
093             * @return the return value of the method call
094             * @throws TestExtensionException
095             *             if no method, which suites to the args, was found or any
096             *             other error occures.
097             */
098            Object call(final Object arg1, final Object arg2, final Object arg3)
099                            throws TestExtensionException;
100    }