1 16 package org.apache.taglibs.string; 17 18 import javax.servlet.jsp.JspException ; 19 import org.apache.commons.lang.StringUtils; 20 21 35 public class ReverseDelimitedStringTag extends StringTagSupport { 36 37 private char delimiter; 38 39 public ReverseDelimitedStringTag() { 40 super(); 41 } 42 43 48 public char getDelimiter() { 49 return this.delimiter; 50 } 51 52 57 public void setDelimiter(char delimiter) { 58 this.delimiter = delimiter; 59 } 60 61 62 63 public String changeString(String text) throws JspException { 64 return StringUtils.reverseDelimited(text, delimiter); 65 } 66 67 public void initAttributes() { 68 69 this.delimiter = '.'; 70 71 } 72 73 } 74 | Popular Tags |