Package net.ontopia.topicmaps.utils
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 TypeMethodDescriptionbooleanPUBLIC: Indicates that the service can supply a TopicMapReaderIF implementation for the specified resource.booleanPUBLIC: 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.PUBLIC: Create and return a TopicMapReaderIF for the specified resource.getWriter(OutputStream stream) PUBLIC: Create and return a TopicMapWriterIF for the specified stream.
-
Method Details
-
canRead
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
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
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
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 forreferenceId- The id to use for the referencetitle- The title to use for the referencebaseAddress- The base address to use if supported- Returns:
- the reference for the specified resource
-