ro.isdc.wro.extensions.processor.js.DustJsProcessor Maven / Gradle / Ivy
package ro.isdc.wro.extensions.processor.js;
import org.apache.commons.io.FilenameUtils;
import ro.isdc.wro.extensions.processor.support.dustjs.DustJs;
import ro.isdc.wro.extensions.processor.support.template.AbstractJsTemplateCompiler;
import ro.isdc.wro.model.resource.Resource;
import ro.isdc.wro.model.resource.ResourceType;
import ro.isdc.wro.model.resource.SupportedResourceType;
/**
* A processor for dustJs template framework. Uses dustjs library to
* transform a template into plain javascript.
*
* @author Eivind Barstad Waaler
* @since 1.4.5
* @created 8 Mar 2012
*/
@SupportedResourceType(ResourceType.JS)
public class DustJsProcessor extends JsTemplateCompilerProcessor {
public static final String ALIAS = "dustJs";
@Override
protected AbstractJsTemplateCompiler createCompiler() {
return new DustJs();
}
@Override
protected String getArgument(Resource resource) {
final String name = resource == null ? "" : FilenameUtils.getBaseName(resource.getUri());
return String.format("'%s'", name);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy