|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectAbstractFactory
org.extex.engine.backend.OutputFactory
public class OutputFactory
This factory creates an output stream from a specification in the configuration.
| Constructor Summary | |
|---|---|
OutputFactory(java.lang.String[] outdirs,
java.lang.String basename)
Creates a new object. |
|
| Method Summary | |
|---|---|
java.io.OutputStream |
getOutputStream(java.lang.String name,
java.lang.String type)
Create an output stream of a certain type. |
protected java.io.OutputStream |
openOutputStream(java.lang.String dir,
java.lang.String filename,
boolean isDefault)
This method tries to open a new output stream. |
void |
register(OutputStreamObserver observer)
Register an observer which is invoked to notify about any output stream requested via a call to getOututStream(), |
void |
register(java.lang.String type,
OutputFactory factory)
Register a handler for creation of an output stream of a certain type. |
void |
setDefaultStream(java.io.OutputStream defaultStream)
Setter for defaultStream. |
void |
setExtension(java.lang.String extension)
Setter for the default extension. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OutputFactory(java.lang.String[] outdirs,
java.lang.String basename)
outdirs - the list of output directoriesbasename - the base name of the main stream| Method Detail |
|---|
public java.io.OutputStream getOutputStream(java.lang.String name,
java.lang.String type)
throws DocumentWriterException
getOutputStream in interface OutputStreamFactoryname - the name of the file to opentype - the type of the file
null if none could be
opened.
DocumentWriterException - in case of an errorOutputStreamFactory.getOutputStream(
java.lang.String, java.lang.String)
protected java.io.OutputStream openOutputStream(java.lang.String dir,
java.lang.String filename,
boolean isDefault)
dir - the directory or nullfilename - the file nameisDefault - the indicator whether the file should be saved
nullpublic void register(OutputStreamObserver observer)
register in interface OutputStreamFactoryobserver - the observers to registerOutputStreamFactory.register(
org.extex.backend.outputStream.OutputStreamObserver)
public void register(java.lang.String type,
OutputFactory factory)
You can register a handler if you want to redirect certain output streams to different directions. For instance if you want to process an output stream in memory. For instance this can be the case if an integrated preview can be used instead of writing the output to a file.
type - the typefactory - the handler to be invokedpublic void setDefaultStream(java.io.OutputStream defaultStream)
defaultStream - the defaultStream to setpublic void setExtension(java.lang.String extension)
null.
setExtension in interface OutputStreamFactoryextension - the default extensionOutputStreamFactory.setExtension(
java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||