MasterEx commented on a change in pull request #2169: URL: https://github.com/apache/netbeans/pull/2169#discussion_r467316999
########## File path: ide/db.dataview/src/org/netbeans/modules/db/dataview/output/dataexport/CSVCommonsDataExporter.java ########## @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.netbeans.modules.db.dataview.output.dataexport; + +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import org.apache.commons.csv.CSVFormat; +import org.apache.commons.csv.CSVPrinter; +import org.openide.util.Exceptions; + +/** + * + * Exports the given data to the target file in the provided CSV format. + * + * @author Periklis Ntanasis <[email protected]> + */ +public interface CSVCommonsDataExporter { + + default void exportData(String[] headers, Object[][] contents, File file, CSVFormat format) { Review comment: After some thought I have rewritten the interfaces as abstract classes. Some code duplication is avoided that way. Eventually I haven't implemented the exporters as singletons because actually it doesn't really matter if there are more than one instances at the same time and this results in simpler implementation. Please, let me know if you see any other improvement. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
