1 package org.apache.turbine.services.template.mapper; 2 3 18 19 import org.apache.commons.lang.StringUtils; 20 21 import org.apache.turbine.services.template.TemplateService; 22 23 30 public class DirectMapper 31 extends BaseMapper 32 implements Mapper 33 { 34 39 public DirectMapper() 40 { 41 } 42 43 51 public String doMapping(String template) 52 { 53 String [] components 54 = StringUtils.split(template, String.valueOf(TemplateService.TEMPLATE_PARTS_SEPARATOR)); 55 56 String className = components[components.length - 1]; 57 58 int dotIndex = className.lastIndexOf(TemplateService.EXTENSION_SEPARATOR); 60 className = (dotIndex < 0) ? className : className.substring(0, dotIndex); 61 components[components.length -1] = className; 62 63 return StringUtils.join(components, String.valueOf(separator)); 65 } 66 } 67 | Popular Tags |