01: /*
02: * Created on Jul 14, 2003
03: *
04: * To change the template for this generated file go to
05: * Window>Preferences>Java>Code Generation>Code and Comments
06: */
07: package org.xdev.base.xssl.text;
08:
09: import java.util.ArrayList;
10: import java.util.HashMap;
11: import java.util.regex.Matcher;
12: import java.util.regex.Pattern;
13:
14: import org.xdev.base.xssl.XSSLReturn;
15:
16: /**
17: * @author AYegorov
18: *
19: * To change the template for this generated type comment go to
20: * Window>Preferences>Java>Code Generation>Code and Comments
21: */
22: public class TextTrim extends AbstractText {
23: /**
24: * @param id
25: */
26: public TextTrim(String id) {
27: super (id);
28: // TODO Auto-generated constructor stub
29: }
30:
31: /**
32: * @param id
33: * @param properties
34: */
35: public TextTrim(String id, HashMap properties) {
36: super (id, properties);
37: // TODO Auto-generated constructor stub
38: }
39:
40: /* (non-Javadoc)
41: * @see org.xdev.base.transaction.AbstractTransactionResult#getValue()
42: */
43: public Object processText(String text) throws Exception {
44: Pattern p = this .getPatternProperty("expression");
45:
46: Matcher m = p.matcher(text);
47:
48: return m.replaceAll("");
49: }
50:
51: }
|