001 /**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.krad.bo;
017
018 import org.kuali.rice.krad.exception.ExportNotSupportedException;
019
020 import java.io.IOException;
021 import java.io.OutputStream;
022 import java.util.List;
023
024 /**
025 * An Exporter provides the ability to export a List of BusinessObjects to a
026 * supported ExportFormat.
027 *
028 * @author Kuali Rice Team (rice.collab@kuali.org)
029 */
030 public interface Exporter {
031
032 /**
033 * Exports the List of BusinessObjects to the specified ExportFormat. The
034 * resulting output of the export operation should be written to the given
035 * OutputStream.
036 *
037 * @param dataObjectClass
038 * the type of DataObjects being exported
039 * @param data
040 * a List of DataObjects to export
041 * @param exportFormat
042 * the export format in which to export the DataObjects
043 * @param outputStream
044 * the OutputStream to write the exported data to
045 *
046 * @throws IOException
047 * if the process encounters an I/O issue
048 * @throws ExportNotSupportedException
049 * if the given ExportFormat is not supported
050 */
051 public void export(Class<?> dataObjectClass,
052 List<? extends Object> dataObjects, String exportFormat,
053 OutputStream outputStream) throws IOException, ExportNotSupportedException;
054
055 /**
056 * Returns a List of ExportFormats supported by this Exporter for the given
057 * DataOject class.
058 *
059 * @param dataObjectClass
060 * the class of the DataObjects being exported
061 * @return a List of supported ExportFormats
062 */
063 public List<String> getSupportedFormats(Class<?> dataObjectClass);
064
065 }