Interface ImportExportServiceIF

All Known Implementing Classes:
RDFImporterExporterService

public interface ImportExportServiceIF
Service definition for services that provide format reader and writers.
Since:
5.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRead(URL resource)
    PUBLIC: Indicates that the service can supply a TopicMapReaderIF implementation for the specified resource.
    boolean
    canWrite(URL resource)
    PUBLIC: Indicates that the service can supply a TopicMapWriterIF implementation for the specified resource.
    createReference(URL url, String referenceId, String title, LocatorIF baseAddress)
    PUBLIC: Creates an AbstractURLTopicMapReference for the specified url, using the appropriate reader and/or writer provided by this service.
    getReader(URL resource)
    PUBLIC: Create and return a TopicMapReaderIF for the specified resource.
    PUBLIC: Create and return a TopicMapWriterIF for the specified stream.
  • Method Details

    • canRead

      boolean canRead(URL resource)
      PUBLIC: Indicates that the service can supply a TopicMapReaderIF implementation for the specified resource.
      Parameters:
      resource - The resource a reader is needed for
      Returns:
      true if this service can provide the needed reader
    • canWrite

      boolean canWrite(URL resource)
      PUBLIC: Indicates that the service can supply a TopicMapWriterIF implementation for the specified resource.
      Parameters:
      resource - The resource a writer is needed for
      Returns:
      true if this service can provide the needed writer
    • getWriter

      TopicMapWriterIF getWriter(OutputStream stream) throws IOException
      PUBLIC: Create and return a TopicMapWriterIF for the specified stream. This method should be preceded with a call to #canWrite(java.lang.String) to check if this service can write to the resource which the stream is connected to.
      Parameters:
      stream - The stream to write to
      Returns:
      The TopicMapWriterIF created by this service
      Throws:
      IOException - if anything goes wrong during initialization of the writer regarding IO operations
    • getReader

      TopicMapReaderIF getReader(URL resource)
      PUBLIC: Create and return a TopicMapReaderIF for the specified resource. This method should be preceded with a call to #canRead(java.lang.String) to check if this service can read the specified resource.
      Parameters:
      resource - The resource to create a reader for
      Returns:
      The TopicMapReaderIF created by this service
    • createReference

      AbstractURLTopicMapReference createReference(URL url, String referenceId, String title, LocatorIF baseAddress)
      PUBLIC: Creates an AbstractURLTopicMapReference for the specified url, using the appropriate reader and/or writer provided by this service. This method is used by the sources like URLTopicMapSource and ResourceTopicMapSource.
      Parameters:
      url - The resource to create the reference for
      referenceId - The id to use for the reference
      title - The title to use for the reference
      baseAddress - The base address to use if supported
      Returns:
      the reference for the specified resource