us.codecraft.webmagic.samples.formatter.StringTemplateFormatter Maven / Gradle / Ivy
package us.codecraft.webmagic.samples.formatter;
import us.codecraft.webmagic.model.formatter.ObjectFormatter;
/**
* @author [email protected]
*/
public class StringTemplateFormatter implements ObjectFormatter {
private String template;
@Override
public String format(String raw) throws Exception {
return String.format(template, raw);
}
@Override
public Class clazz() {
return String.class;
}
@Override
public void initParam(String[] extra) {
template = extra[0];
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy