View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.portals.applications.transform;
18  
19  import java.io.OutputStream;
20  import java.io.Writer;
21  import java.util.Map;
22  
23  import org.w3c.dom.Document;
24  import org.xml.sax.InputSource;
25  
26  
27  /***
28   * This interface is a facade for all Transformation related operations.
29   * Transformation service abstracts the XSL Transform manipulation, maintenance,
30   * caching and transformation resolution algorithms.
31   * 
32   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
33   * @version $Id: Transform.java 516448 2007-03-09 16:25:47Z ate $
34   */
35  public interface Transform
36  {
37      
38      /***
39       * Performs a transform on an input stream, writing the transformed content to a Writer
40       * 
41       * @param xsltPath The path to a local XSLT file 
42       * @param inputSource The input stream and description containing content to be transformed.
43       * @param writer The output stream receiving the transformed content.
44       * @param properties Map of XSLT properties passed into transformer
45       */    
46      public void transform(String xsltPath, InputSource inputSource, Writer writer, Map properties)
47          throws TransformException;
48  
49      /***
50       * Performs a transform on an input stream, writing the transformed content to a Writer
51       * 
52       * @param xsltPath The path to a local XSLT file 
53       * @param inputSource The input stream and description containing content to be transformed.
54       * @param outputStream The output stream receiving the transformed content.
55       * @param properties Map of XSLT properties passed into transformer
56       */    
57      public void transform(String xsltPath, InputSource inputSource, OutputStream os, Map properties)
58          throws TransformException;
59      
60          
61      /***
62       * Performs a transform on an input stream, writing the transformed content to a Writer
63       * 
64       * @param xsltPath The path to a local XSLT file 
65       * @param document The W3C document to be transformed.
66       * @param outputStream The output stream receiving the transformed content.
67       * @param properties Map of XSLT properties passed into transformer
68       */    
69      public TransformObjectPublisher getPublisher();
70  
71      public void transform(String xsltPath, Document document, OutputStream os, Map parameters)
72          throws TransformException;
73      
74  }