info.textgrid.utils.linkrewriter
Interface ILinkRewriter

All Known Implementing Classes:
AbstractRewriter, ConfigurableXMLRewriter, SimpleTextRewriter, XMLLinkRewriter

public interface ILinkRewriter

A link rewriter can rewrite links according to a mapping file.

Author:
vitt
See Also:
AbstractRewriter

Method Summary
Modifier and Type Method and Description
 ImportMapping getMapping()
          Returns the mapping object that describes the neccessary rewrite actions
 boolean isExport()
          If this is true, the rewriting operation is intended for an export situation, i.e.
 void rewrite(InputStream input, OutputStream output)
          Copies contents from input to output, rewriting links according to the mapping and the export setting, in an implementation dependent manner.
 

Method Detail

getMapping

ImportMapping getMapping()
Returns the mapping object that describes the neccessary rewrite actions


isExport

boolean isExport()
If this is true, the rewriting operation is intended for an export situation, i.e. TextGrid URIs are converted to local URIs.


rewrite

void rewrite(InputStream input,
             OutputStream output)
             throws IOException,
                    XMLStreamException
Copies contents from input to output, rewriting links according to the mapping and the export setting, in an implementation dependent manner.

Parameters:
input - the stream from which the rewriter reads
output - the stream to which the rewriter writes the rewritten code
Throws:
IOException - if reading or writing fails
XMLStreamException - on fatal errors during XML processing.


Copyright © 2012 TextGrid. All Rights Reserved.