org.scijava.text
Interface TextService

All Superinterfaces:
Comparable<Prioritized>, Contextual, Disposable, HandlerService<File,TextFormat>, HasPluginInfo, Prioritized, PTService<TextFormat>, RichPlugin, SciJavaPlugin, SciJavaService, Service, SingletonService<TextFormat>, Typed<File>, TypedService<File,TextFormat>
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
 String asHTML(File file)
          Expresses the given text string as HTML.
 TextFormat getHandler(File file)
          Gets the text format which best handles the given file.
 List<TextFormat> getInstances()
          Gets the list of available text formats.
 String open(File file)
          Reads the data from the given file into a string.
 boolean supports(File file)
          Gets whether the given file contains text data in a supported format.
 
Methods inherited from interface org.scijava.plugin.SingletonService
getInstance
 
Methods inherited from interface org.scijava.plugin.PTService
create, getPlugins, getPluginService, getPluginType
 
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Disposable
dispose
 
Methods inherited from interface org.scijava.Typed
getType
 

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

TextFormat getHandler(File file)
Gets the text format which best handles the given file.

Specified by:
getHandler in interface HandlerService<File,TextFormat>

getInstances

List<TextFormat> getInstances()
Gets the list of available text formats.

Specified by:
getInstances in interface HandlerService<File,TextFormat>
Specified by:
getInstances in interface SingletonService<TextFormat>

supports

boolean supports(File file)
Gets whether the given file contains text data in a supported format.

Specified by:
supports in interface HandlerService<File,TextFormat>
Specified by:
supports in interface Typed<File>


Copyright © 2009–2015 SciJava. All rights reserved.