org.mockcentral.editor.nodes.expectation
Class MethodNameValidator

java.lang.Object
  extended by org.mockcentral.editor.nodes.expectation.MethodNameValidator

public class MethodNameValidator
extends java.lang.Object

Class used to validate a method name for an Mock Object method expectation.

Author:
David Hutchinson

Constructor Summary
MethodNameValidator(IMethodsListEditor editor)
          Creates a new instance.
 
Method Summary
 java.lang.String isValidMethodName(java.lang.String methodName, java.lang.Object excluded)
          Returns whether the supplied method name is valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodNameValidator

public MethodNameValidator(IMethodsListEditor editor)
Creates a new instance.

Parameters:
editor - the IMethodsListEditor used to manage the edit.
Method Detail

isValidMethodName

public java.lang.String isValidMethodName(java.lang.String methodName,
                                          java.lang.Object excluded)
Returns whether the supplied method name is valid. Specifically, it must not be empty and must not be a duplicate.

Parameters:
methodName - the name for the methd.
excluded - the object (if any) to exclude from duplication-checking. If an existing expectation is currently being edited, this will be its model.
Returns:
a String containing a message indicating why the method name is invalid, or null.