1 16 17 package org.apache.jetspeed.services; 18 19 import java.io.Reader ; 21 22 import org.apache.jetspeed.services.transformer.TransformerService; 24 25 import org.apache.turbine.services.TurbineServices; 27 28 29 37 public class Transformer { 38 39 43 private static TransformerService getService() 44 { 45 return (TransformerService)TurbineServices 46 .getInstance() 47 .getService(TransformerService.SERVICE_NAME); 48 } 49 50 53 public static String findElement(Reader htmlReader, String url, String element) 54 { 55 return getService().findElement(htmlReader, url, element); 56 } 57 58 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 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 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 } 96 | Popular Tags |