| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| Exporter | 
  | 
  | 1.0;1 | 
| 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 | |
| 26 |   * supported ExportFormat. | |
| 27 |   *  | |
| 28 |   * @author Kuali Rice Team (rice.collab@kuali.org) | |
| 29 |   */ | |
| 30 | public interface Exporter {  | |
| 31 | ||
| 32 |          /** | |
| 33 |           * Exports the List of BusinessObjects to the specified ExportFormat. The | |
| 34 |           * resulting output of the export operation should be written to the given | |
| 35 |           * OutputStream. | |
| 36 |           *  | |
| 37 |           * @param dataObjectClass | |
| 38 |           *            the type of DataObjects being exported | |
| 39 |           * @param data | |
| 40 |           *            a List of DataObjects to export | |
| 41 |           * @param exportFormat | |
| 42 |           *            the export format in which to export the DataObjects | |
| 43 |           * @param outputStream | |
| 44 |           *            the OutputStream to write the exported data to | |
| 45 |           *  | |
| 46 |           * @throws IOException | |
| 47 |           *             if the process encounters an I/O issue | |
| 48 |           * @throws ExportNotSupportedException | |
| 49 |           *             if the given ExportFormat is not supported | |
| 50 |           */ | |
| 51 | public void export(Class<?> dataObjectClass,  | |
| 52 |                          List<? extends Object> dataObjects, String exportFormat, | |
| 53 |                          OutputStream outputStream) throws IOException, | |
| 54 | ExportNotSupportedException;  | |
| 55 | ||
| 56 |          /** | |
| 57 |           * Returns a List of ExportFormats supported by this Exporter for the given | |
| 58 |           * DataOject class. | |
| 59 |           *  | |
| 60 |           * @param dataObjectClass | |
| 61 |           *            the class of the DataObjects being exported | |
| 62 |           * @return a List of supported ExportFormats | |
| 63 |           */ | |
| 64 |          public List<String> getSupportedFormats(Class<?> dataObjectClass); | |
| 65 | ||
| 66 | }  |