org.mockcentral.editor.nodes.expectation_group
Interface IMethodsListEditor

All Known Implementing Classes:
ExpectationGroupModel

public interface IMethodsListEditor

Interface for classes that handle edits to a Mock Object definition's list of method expectations.

Author:
David Hutchinson

Method Summary
 MockCentralTableModel<MockableMethod> getMethodNamesTableModel(java.lang.Class<?> clazz, boolean includeObjectMethods)
          Returns a MockCentralTableModel build from the supplied Class instance's methods.
 boolean isDefaultMethodVersionInUse(java.lang.reflect.Method method, boolean matchAnyParams)
          Returns whether the default version of a mocked method is already in use for the current Mock Object.
 boolean isMethodNameInUse(java.lang.String methodName, java.lang.Object excluded)
          Returns whether the supplied method name is currently in use within the list of Mock Object method expectations.
 

Method Detail

getMethodNamesTableModel

MockCentralTableModel<MockableMethod> getMethodNamesTableModel(java.lang.Class<?> clazz,
                                                               boolean includeObjectMethods)
Returns a MockCentralTableModel build from the supplied Class instance's methods. If the includeObjectMethods flag is set, this model will also include all java.lang.Object methods. The resulting table is populated with MockableMethod objects.

Parameters:
clazz - the Class.
includeObjectMethods - whether to include java.lang.Object methods.
Returns:
a MockCentralTableModel build from the supplied Class instance's methods.

isMethodNameInUse

boolean isMethodNameInUse(java.lang.String methodName,
                          java.lang.Object excluded)
Returns whether the supplied method name is currently in use within the list of Mock Object method expectations.

Parameters:
methodName - the method name.
excluded - an Object to exclude from duplication testing.
Returns:
whether the supplied method name is currently in use within the list of Mock Object method expectations.

isDefaultMethodVersionInUse

boolean isDefaultMethodVersionInUse(java.lang.reflect.Method method,
                                    boolean matchAnyParams)
Returns whether the default version of a mocked method is already in use for the current Mock Object. The default version is created from the method signature to assign default values to any parameters and return value.

Parameters:
method - the Method to be mocked.
matchAnyParams - whether to match any parameters, i.e. return true if the method name is in use at all.
Returns:
whether the default version of a mocked method is already in use.