@Override
	protected DetailedModuleDefinitionResource instantiateResource(ModuleDefinition entity) {
		DetailedModuleDefinitionResource result = new DetailedModuleDefinitionResource(entity.getName(),
				entity.getType().name(), entity.isComposed());

		ModuleOptionsMetadata moduleOptionsMetadata = moduleOptionsMetadataResolver.resolve(entity);
		if (!(moduleOptionsMetadata instanceof PassthruModuleOptionsMetadata)) {
			for (ModuleOption option : moduleOptionsMetadata) {
				Object defaultValue = option.getDefaultValue();
				String type = option.getType();

				final String defaultValueAsString;

				if (Password.class.getName().equals(type) && defaultValue != null) {
					defaultValueAsString = "******";
				}
				else if (defaultValue == null) {
					defaultValueAsString = null;
				}
				else {
					defaultValueAsString = defaultValue.toString();
				}

				result.addOption(new DetailedModuleDefinitionResource.Option(option.getName(),
						type == null ? null : type, option.getDescription(),
								defaultValueAsString, option.isHidden()));
			}
		}

		ModuleInformation moduleInformation = moduleInformationResolver.resolve(entity);
		if (moduleInformation != null) {
			result.setShortDescription(moduleInformation.getShortDescription());
		}
		return result;
	}
Knows how to build {@link DetailedModuleDefinitionResource} out of a {@link ModuleDefinition}.

@author Eric Bottard
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/rest/DetailedModuleDefinitionResourceAssembler.java