Interface FileExtension<T extends File>

  • All Known Implementing Classes:
    CaseExtension

    public interface FileExtension<T extends File>
    Interface to add a new type of file to the application file system.

    In order to add a new type of file to your AppData instance, you need to implement that interface and declare it to the runtime using the AutoService annotation.

    The instance needs to define the new class, a name identifying that class ("pseudo class"), and to provide a creation method for those new file objects. For instance:

     @AutoService
     public class MyFileExtension implements FileExtension<MyFile> {
    
        @Override
        public Class getFileClass() { return MyFile.class; }
    
        @Override
        public String getFilePseudoClass() { return "myFile"; }
    
        @Override
        public T createFile(FileCreationContext context) { return new MyFileExtension(context); }
     }
     
    Author:
    Geoffroy Jamgotchian
    • Method Detail

      • getFileClass

        Class<T> getFileClass()
        The new type of object you want to add to your application file system.
      • getFilePseudoClass

        String getFilePseudoClass()
        A "pseudo class" name for the new type.
      • createFile

        T createFile​(FileCreationContext context)
        Creates an actual instance of the new type of file.