All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.talk2object.plum.interaction.view.annotation.parameter.helper.FileParameterWrapper Maven / Gradle / Ivy

package com.talk2object.plum.interaction.view.annotation.parameter.helper;

import com.talk2object.plum.interaction.rich.field.FileField;
import com.talk2object.plum.interaction.rich.field.InteractiveField;
import com.talk2object.plum.interaction.view.annotation.parameter.FileParameter;

public class FileParameterWrapper extends AbstractParameterWrapper {

	private FileParameter getFileParameter() {
		return (FileParameter) parameter;
	}

	@Override
	public Object getInitValue() {
		// not support
		return null;
	}

	@Override
	Object[] getOptionValues() {
		// not support
		return new Object[0];

	}

	@Override
	public Object value2Object(Object value) {
		throw new RuntimeException("not support");
	}

	@Override
	public void enrich(InteractiveField input) {

		super.enrich(input);

		FileField fileInput = (FileField) input;

		FileParameter fileParameter = getFileParameter();
		String contentType = fileParameter.contentType();
		if (contentType != null && !contentType.isEmpty())
			fileInput.setContentType(contentType);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy