private ModuleType resolveModuleType(String moduleName, ModuleType... candidates) {
		for (ModuleType type : candidates) {
			ModuleDefinition def = moduleRegistry.findDefinition(moduleName, type);
			if (def != null) {
				return type;
			}
		}
		throw new NoSuchModuleException(moduleName, candidates);
	}
Return the module type for the module name. Based on the position
in the stream definition, the module <b>must</b> be one of the
types passed into {@code candidates}.

@param moduleName name of module
@param candidates the list of module types the module can be
@return the module type for the module name
@throws NoSuchModuleException if no module with this name exists for one of
                              the types present in {@code candidates}
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/XDStreamParser.java