1 /*
2 * Copyright 2007-2008 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.kns.bo;
17
18 import java.io.IOException;
19 import java.io.OutputStream;
20 import java.util.List;
21
22 import org.kuali.rice.kns.exception.ExportNotSupportedException;
23
24 /**
25 * An Exporter provides the ability to export a List of BusinessObjects to a supported ExportFormat.
26 *
27 * @author Kuali Rice Team (rice.collab@kuali.org)
28 *
29 */
30 public interface Exporter {
31
32 /**
33 * Exports the List of BusinessObjects to the specified ExportFormat. The resulting output of the export operation
34 * should be written to the given OutputStream.
35 *
36 * @param businessObjectClass the type of BusinessObjects being exported
37 * @param data a List of BusinessObjects to export
38 * @param exportFormat the export format in which to export the BusinessObjects
39 * @param outputStream the OutputStream to write the exported data to
40 *
41 * @throws IOException if the process encounters an I/O issue
42 * @throws ExportNotSupportedException if the given ExportFormat is not supported
43 */
44 public void export(Class<? extends BusinessObject> businessObjectClass, List<BusinessObject> data, String exportFormat, OutputStream outputStream) throws IOException, ExportNotSupportedException;
45
46 /**
47 * Returns a List of ExportFormats supported by this Exporter for the given BusinessOject class.
48 * This method ...
49 *
50 * @param businessObjectClass the class of the BusinessObjects being exported
51 * @return a List of supported ExportFormats
52 */
53 public List<String> getSupportedFormats(Class<? extends BusinessObject> businessObjectClass);
54
55 }