private ModuleType determineType(ModuleDescriptor.Builder builder, int lastIndex, ParsingContext parsingContext) {
		ModuleType moduleType = determineTypeFromNamedChannels(builder, lastIndex, parsingContext);
		if (moduleType != null) {
			return moduleType;
		}
		String name = builder.getModuleName();
		int index = builder.getIndex();

		return resolveModuleType(name, parsingContext.allowed(Position.of(index, lastIndex)));
	}
For a given module builder, determine the type of module based on:
<ol>
    <li>module name</li>
    <li>module position in the stream</li>
    <li>presence of (or lack thereof) named channels</li>
</ol>

@param builder          builder object
@param lastIndex        index of last module in the stream
@param parsingContext   parsing context
@return module type
@throws NoSuchModuleException if the module type does not exist
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/stream/XDStreamParser.java