@Override
	public ModuleOptionsMetadata resolve(ModuleDefinition moduleDefinition) {
		List<ModuleOptionsMetadata> moms = new ArrayList<ModuleOptionsMetadata>();
		ModuleType type = moduleDefinition.getType();
		if (type == source || type == processor) {
			moms.add(new PojoModuleOptionsMetadata(OutputOptionsMetadata.class, conversionService));
		}
		if (type == sink || type == processor) {
			moms.add(new PojoModuleOptionsMetadata(InputOptionsMetadata.class, conversionService));
		}

		// Don't force deep layering if it's not needed
		switch (moms.size()) {
			case 0:
				return null;
			case 1:
				return moms.iterator().next();
			default:
				return new FlattenedCompositeModuleOptionsMetadata(moms);
		}
	}
A {@link ModuleOptionsMetadataResolver} that will dynamically add {@code inputType} and {@code outputType} options to
every module, according to their type.

@see ModuleTypeConversionPlugin
@author Eric Bottard
@author David Turanski
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/plugins/stream/ModuleTypeConversionPluginMetadataResolver.java