1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.services;
18
19
20 import java.io.Reader;
21
22
23 import org.apache.jetspeed.services.transformer.TransformerService;
24
25
26 import org.apache.turbine.services.TurbineServices;
27
28
29 /***
30 * <P>This is a commodity static accessor class around the
31 * <code>TransformerService</code></P>
32 *
33 * @see org.apache.jetspeed.services.transformer.TransformerService
34 * @author <a href="mailto:mmari@ce.unipr.it">Marco Mari</a>
35 * @version $Id: Transformer.java,v 1.2 2004/02/23 04:00:57 jford Exp $
36 */
37 public class Transformer {
38
39 /***
40 * Commodity method for getting a reference to the service
41 * singleton
42 */
43 private static TransformerService getService()
44 {
45 return (TransformerService)TurbineServices
46 .getInstance()
47 .getService(TransformerService.SERVICE_NAME);
48 }
49
50 /***
51 * @see org.apache.jetspeed.services.transformer.TransformerService#findElement
52 */
53 public static String findElement(Reader htmlReader, String url, String element)
54 {
55 return getService().findElement(htmlReader, url, element);
56 }
57
58 /***
59 * @see org.apache.jetspeed.services.transformer.TransformerService#clipElements
60 */
61 public static String clipElements(Reader htmlReader,
62 String url,
63 String startElement,
64 String stopElement)
65 {
66 return getService().clipElements(htmlReader, url, startElement, stopElement);
67 }
68
69 /***
70 * @see org.apache.jetspeed.services.transformer.TransformerService#findElementNumber
71 */
72 public static String findElementNumber(Reader htmlReader,
73 String url,
74 String element,
75 int tagNumber)
76 {
77 return getService().findElementNumber(htmlReader, url, element, tagNumber);
78 }
79
80 /***
81 * @see org.apache.jetspeed.services.transformer.TransformerService#clipElementsNumber
82 */
83 public static String clipElementsNumber(Reader htmlReader,
84 String url,
85 String startElement,
86 String stopElement,
87 int tagNumber)
88 {
89 return getService().clipElementsNumber(htmlReader,
90 url,
91 startElement,
92 stopElement,
93 tagNumber);
94 }
95 }