Package org.scijava.text
Interface TextService
-
- All Superinterfaces:
Comparable<Prioritized>,Contextual,Disposable,HandlerService<File,TextFormat>,HasPluginInfo,Identifiable,Initializable,Locatable,Logged,Prioritized,PTService<TextFormat>,RichPlugin,SciJavaPlugin,SciJavaService,Service,SingletonService<TextFormat>,Typed<File>,TypedService<File,TextFormat>,Versioned
- All Known Implementing Classes:
DefaultTextService
public interface TextService extends HandlerService<File,TextFormat>, SciJavaService
Interface for service that works with text formats.- Author:
- Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringasHTML(File file)Expresses the given text string as HTML.default TextFormatgetHandler(File file)Gets the text format which best handles the given file.List<TextFormat>getInstances()Gets the list of available text formats.Stringopen(File file)Reads the data from the given file into a string.default booleansupports(File file)Gets whether the given file contains text data in a supported format.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.PTService
getPlugins, getPluginService, getPluginType, pluginService
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
-
Methods inherited from interface org.scijava.plugin.SingletonService
create, filterInstances, getInstance, initialize, objectService
-
Methods inherited from interface org.scijava.plugin.TypedService
find
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
open
String open(File file) throws IOException
Reads the data from the given file into a string.- Throws:
IOException
-
asHTML
String asHTML(File file) throws IOException
Expresses the given text string as HTML.- Throws:
IOException
-
getHandler
default TextFormat getHandler(File file)
Gets the text format which best handles the given file.- Specified by:
getHandlerin interfaceHandlerService<File,TextFormat>
-
getInstances
List<TextFormat> getInstances()
Gets the list of available text formats.- Specified by:
getInstancesin interfaceHandlerService<File,TextFormat>- Specified by:
getInstancesin interfaceSingletonService<TextFormat>
-
supports
default boolean supports(File file)
Gets whether the given file contains text data in a supported format.- Specified by:
supportsin interfaceHandlerService<File,TextFormat>- Specified by:
supportsin interfaceTyped<File>
-
-