View Javadoc

1   package org.apache.turbine.services.xslt;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.io.Reader;
23  import java.io.Writer;
24  import java.util.Map;
25  
26  import org.apache.turbine.services.TurbineServices;
27  import org.w3c.dom.Node;
28  
29  /***
30   * This is a static accesor class for {@link XSLTService}.
31   *
32   * @author <a href="mailto:leon@opticode.co.za">Leon Messerschmidt</a>
33   * @author <a href="thomas.vandahl@tewisoft.de">Thomas Vandahl</a>
34   * @version $Id: TurbineXSLT.java 534527 2007-05-02 16:10:59Z tv $
35   */
36  public class TurbineXSLT
37  {
38      /***
39       * Utility method for accessing the service
40       * implementation
41       *
42       * @return a XSLTService implementation instance
43       */
44      protected static XSLTService getService()
45      {
46          return (XSLTService) TurbineServices
47                  .getInstance().getService(XSLTService.SERVICE_NAME);
48      }
49  
50      public static void transform(String xslName, Reader in, Writer out)
51              throws Exception
52      {
53          getService().transform(xslName, in, out);
54      }
55  
56      public static String transform(String xslName, Reader in)
57              throws Exception
58      {
59          return getService().transform(xslName, in);
60      }
61  
62      public void transform(String xslName, Node in, Writer out)
63              throws Exception
64      {
65          getService().transform(xslName, in, out);
66      }
67  
68      public String transform(String xslName, Node in)
69              throws Exception
70      {
71          return getService().transform(xslName, in);
72      }
73  
74      public static void transform(String xslName, Reader in, Writer out, Map params)
75              throws Exception
76      {
77          getService().transform(xslName, in, out, params);
78      }
79  
80      public static String transform(String xslName, Reader in, Map params)
81              throws Exception
82      {
83          return getService().transform(xslName, in, params);
84      }
85  
86      public void transform(String xslName, Node in, Writer out, Map params)
87              throws Exception
88      {
89          getService().transform(xslName, in, out, params);
90      }
91  
92      public String transform(String xslName, Node in, Map params)
93              throws Exception
94      {
95          return getService().transform(xslName, in, params);
96      }
97  }