de.yourinspiration.jexpresso.transformer.PlainTextTransformer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jexpresso Show documentation
Show all versions of jexpresso Show documentation
A java web framework inspired by expressjs to build java web application with minimal effort
package de.yourinspiration.jexpresso.transformer;
import de.yourinspiration.jexpresso.http.ContentType;
/**
* Transforms the model data to plain text without any type specific
* transformation.
*
* @author Marcel Härle
*/
public class PlainTextTransformer implements ResponseTransformer {
@Override
public String render(Object model) {
return model != null ? model.toString() : "";
}
@Override
public ContentType contentType() {
return ContentType.TEXT_PLAIN;
}
}