Package net.ontopia.topicmaps.utils.rdf
Class RDFImporterExporterService
- java.lang.Object
-
- net.ontopia.topicmaps.utils.rdf.RDFImporterExporterService
-
- All Implemented Interfaces:
ImportExportServiceIF
public class RDFImporterExporterService extends Object implements ImportExportServiceIF
ImportExportServiceIF service providing RDF import and export functionality.- Since:
- 5.4.0
-
-
Constructor Summary
Constructors Constructor Description RDFImporterExporterService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanRead(URL resource)PUBLIC: Indicates that the service can supply a TopicMapReaderIF implementation for the specified resource.booleancanWrite(URL resource)PUBLIC: Indicates that the service can supply a TopicMapWriterIF implementation for the specified resource.AbstractURLTopicMapReferencecreateReference(URL url, String refid, String title, LocatorIF base_address)PUBLIC: Creates an AbstractURLTopicMapReference for the specified url, using the appropriate reader and/or writer provided by this service.TopicMapReaderIFgetReader(URL resource)PUBLIC: Create and return a TopicMapReaderIF for the specified resource.TopicMapWriterIFgetWriter(OutputStream stream)PUBLIC: Create and return a TopicMapWriterIF for the specified stream.
-
-
-
Method Detail
-
canRead
public boolean canRead(URL resource)
Description copied from interface:ImportExportServiceIFPUBLIC: Indicates that the service can supply a TopicMapReaderIF implementation for the specified resource.- Specified by:
canReadin interfaceImportExportServiceIF- Parameters:
resource- The resource a reader is needed for- Returns:
- true if this service can provide the needed reader
-
canWrite
public boolean canWrite(URL resource)
Description copied from interface:ImportExportServiceIFPUBLIC: Indicates that the service can supply a TopicMapWriterIF implementation for the specified resource.- Specified by:
canWritein interfaceImportExportServiceIF- Parameters:
resource- The resource a writer is needed for- Returns:
- true if this service can provide the needed writer
-
getWriter
public TopicMapWriterIF getWriter(OutputStream stream) throws IOException
Description copied from interface:ImportExportServiceIFPUBLIC: 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.- Specified by:
getWriterin interfaceImportExportServiceIF- 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 TopicMapReaderIF getReader(URL resource)
Description copied from interface:ImportExportServiceIFPUBLIC: 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.- Specified by:
getReaderin interfaceImportExportServiceIF- Parameters:
resource- The resource to create a reader for- Returns:
- The TopicMapReaderIF created by this service
-
createReference
public AbstractURLTopicMapReference createReference(URL url, String refid, String title, LocatorIF base_address)
Description copied from interface:ImportExportServiceIFPUBLIC: 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.- Specified by:
createReferencein interfaceImportExportServiceIF- Parameters:
url- The resource to create the reference forrefid- The id to use for the referencetitle- The title to use for the referencebase_address- The base address to use if supported- Returns:
- the reference for the specified resource
-
-