alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 *
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 *
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.modules.tasklist.core.translators;


import java.io.File;
import org.openide.filesystems.FileObject;
import org.netbeans.modules.tasklist.core.TaskList;

/** Interface which represents a class capable of translating
 * to/from a particular tasklist format, such as ical, vcal, html.
 *
 * @author Tor Norbye, Trond Norbye
 */
public interface FormatTranslator  {

    /** Return the user-visible name of this importer */
    String getImportName();

    /** Return the user-visible name of this exporter. Might be the
        same as getImportName, but you may want to be more specific.
        For example, a translator may understand versions 1, 2 and 3
        of format Foo, but it exports in format 3, so the import name
        might be "Foo" and the export name might be "Foo 3.0".
    */
    String getExportName();

    /** Return true iff this translator supports importing a file */
    boolean supportsImport();

    /** Return true iff this translator supports exporting to a file */
    boolean supportsExport();

    /** Read a file into the given tasklist
        @param list The tasklist to read into
        @param file The FileObject for the file to be read 
        @param path The file path to use, in case file is null.
                    This is because of user mounts, some paths may
                    not be accessible through the filesystems API.
        @param interactive When false, don't prompt the user. When true,
               provide user feedback etc.
    */
    boolean read(TaskList list, FileObject file, File path, boolean interactive)
        throws UnknownFormatException;

    /** Write a tasklist into the given file location
        @param list The tasklist to export
        @param folder The FileObject for the folder in which a file named
                      name should be created.
        @param folderPath The folder path to use, in case file is null.
                    This is because of user mounts, some paths may
                    not be accessible through the filesystems API.
        @param interactive When false, don't prompt the user. When true,
               provide user feedback etc.
        @param backup Save backup file.
    */
    boolean write(TaskList list, FileObject folder, String name, File folderPath,
                  boolean interactive, boolean backup);
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.