@Test public void testGetExecutorInstructionNoParameters () { String instructionName = "instruction name"; InstructionSetImpl userInstructionSet = new InstructionSetImpl (); ClassInstructionSet instructionSet = new ClassInstructionSet (NAME, userInstructionSet, null); assertTrue (instructionSet.getExecutor (instructionName) instanceof MethodExecutor); }
@Override public Executor getExecutor (String instructionName) { String methodName = getMethodName (instructionName); Method method = getMethod (methodName); if (method == null) { method = getAnnotatedMethod (methodName); if (method == null) { return null; } else if (method.isAnnotationPresent (KeywordName.class) && method.isAnnotationPresent (ParameterOrder.class)) { return new ShuffledParametersMethodExecutor (mObject, method, mParameterConvertors); } } else if (method.getParameterTypes ().length == 1 && Map.class.isAssignableFrom (method.getParameterTypes ()[0])) { return new MapMethodExecutor (mObject, method); } return new MethodExecutor (mObject, method, mParameterConvertors); }
ClassInstructionSet implements InstructionSet { @Override public Executor getExecutor (String instructionName) { String methodName = getMethodName (instructionName); Method method = getMethod (methodName); if (method == null) { method = getAnnotatedMethod (methodName); if (method == null) { return null; } else if (method.isAnnotationPresent (KeywordName.class) && method.isAnnotationPresent (ParameterOrder.class)) { return new ShuffledParametersMethodExecutor (mObject, method, mParameterConvertors); } } else if (method.getParameterTypes ().length == 1 && Map.class.isAssignableFrom (method.getParameterTypes ()[0])) { return new MapMethodExecutor (mObject, method); } return new MethodExecutor (mObject, method, mParameterConvertors); } }
ClassInstructionSet implements InstructionSet { @Override public Executor getExecutor (String instructionName) { String methodName = getMethodName (instructionName); Method method = getMethod (methodName); if (method == null) { method = getAnnotatedMethod (methodName); if (method == null) { return null; } else if (method.isAnnotationPresent (KeywordName.class) && method.isAnnotationPresent (ParameterOrder.class)) { return new ShuffledParametersMethodExecutor (mObject, method, mParameterConvertors); } } else if (method.getParameterTypes ().length == 1 && Map.class.isAssignableFrom (method.getParameterTypes ()[0])) { return new MapMethodExecutor (mObject, method); } return new MethodExecutor (mObject, method, mParameterConvertors); } ClassInstructionSet(String name, Object object, ParameterConvertors parameterConvertors); }
ClassInstructionSet implements InstructionSet { @Override public Executor getExecutor (String instructionName) { String methodName = getMethodName (instructionName); Method method = getMethod (methodName); if (method == null) { method = getAnnotatedMethod (methodName); if (method == null) { return null; } else if (method.isAnnotationPresent (KeywordName.class) && method.isAnnotationPresent (ParameterOrder.class)) { return new ShuffledParametersMethodExecutor (mObject, method, mParameterConvertors); } } else if (method.getParameterTypes ().length == 1 && Map.class.isAssignableFrom (method.getParameterTypes ()[0])) { return new MapMethodExecutor (mObject, method); } return new MethodExecutor (mObject, method, mParameterConvertors); } ClassInstructionSet(String name, Object object, ParameterConvertors parameterConvertors); @Override String getName(); @Override void setup(); @Override Executor getExecutor(String instructionName); @Override void cleanup(); }
ClassInstructionSet implements InstructionSet { @Override public Executor getExecutor (String instructionName) { String methodName = getMethodName (instructionName); Method method = getMethod (methodName); if (method == null) { method = getAnnotatedMethod (methodName); if (method == null) { return null; } else if (method.isAnnotationPresent (KeywordName.class) && method.isAnnotationPresent (ParameterOrder.class)) { return new ShuffledParametersMethodExecutor (mObject, method, mParameterConvertors); } } else if (method.getParameterTypes ().length == 1 && Map.class.isAssignableFrom (method.getParameterTypes ()[0])) { return new MapMethodExecutor (mObject, method); } return new MethodExecutor (mObject, method, mParameterConvertors); } ClassInstructionSet(String name, Object object, ParameterConvertors parameterConvertors); @Override String getName(); @Override void setup(); @Override Executor getExecutor(String instructionName); @Override void cleanup();  }