Class FileSearchFactory
java.lang.Object
com.nomagic.magicreport.helper.file.FileSearchFactory
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 Summary
Modifier and TypeMethodDescriptionCreate and return all instance of IFileSearch.static FileSearchFactoryReturn instance of this class.booleanregisterFileSearchClass(Class<? extends IFileSearch> fileSearchClass) Registers the given class name with theFileSearchFactorybooleanunregisterFileSearchClass(Class<? extends IFileSearch> fileSearchClass) Unregister the given file search class.booleanunregisterFileSearchClass(String className) Unregister the given file search class name.
-
Method Details
-
getInstance
Return instance of this class.- Returns:
- instance of this class.
-
registerFileSearchClass
Registers the given class name with theFileSearchFactory- Parameters:
fileSearchClass- the newIFileSearchthat is to be registered with theFileSearchFactory- Returns:
- true if register successful
-
unregisterFileSearchClass
Unregister the given file search class.- Parameters:
fileSearchClass- file search class.- Returns:
- true if unregister successful
-
unregisterFileSearchClass
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
Create and return all instance of IFileSearch.- Returns:
- a list of IFileSearch instance.
-