public interface FileExtension<T extends File>
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 ClassgetFileClass() { return MyFile.class; } @Override public String getFilePseudoClass() { return "myFile"; } @Override public T createFile(FileCreationContext context) { return new MyFileExtension(context); } }
Modifier and Type | Method and Description |
---|---|
T |
createFile(FileCreationContext context)
Creates an actual instance of the new type of file.
|
java.lang.Class<T> |
getFileClass()
The new type of object you want to add to your application file system.
|
java.lang.String |
getFilePseudoClass()
A "pseudo class" name for the new type.
|
java.lang.Class<T> getFileClass()
java.lang.String getFilePseudoClass()
T createFile(FileCreationContext context)
Copyright © 2019. All rights reserved.