Class FileSearchFactory

java.lang.Object
com.nomagic.magicreport.helper.file.FileSearchFactory

@OpenApiAll public final class FileSearchFactory extends Object
Create custom file search. Since a file can be defined in other object besides String of path or File. So, this class allow you to add custom IFileSearch class for searching file from custom object using given name and location.
  • Method Details

    • getInstance

      public static FileSearchFactory getInstance()
      Return instance of this class.
      Returns:
      instance of this class.
    • registerFileSearchClass

      public boolean registerFileSearchClass(Class<? extends IFileSearch> fileSearchClass)
      Registers the given class name with the FileSearchFactory
      Parameters:
      fileSearchClass - the new IFileSearch that is to be registered with the FileSearchFactory
      Returns:
      true if register successful
    • unregisterFileSearchClass

      public boolean unregisterFileSearchClass(Class<? extends IFileSearch> fileSearchClass)
      Unregister the given file search class.
      Parameters:
      fileSearchClass - file search class.
      Returns:
      true if unregister successful
    • unregisterFileSearchClass

      public boolean unregisterFileSearchClass(String className)
      Unregister the given file search class name.
      Parameters:
      className - class name with its package e.g., com.nomagic.magicreport.helper.file.MyFileSearch
      Returns:
      true if unregister successful
    • getFileSearchClass

      public Set<IFileSearch> getFileSearchClass()
      Create and return all instance of IFileSearch.
      Returns:
      a list of IFileSearch instance.