Package de.espirit.firstspirit.generate
Interface ContentProcessor
- All Superinterfaces:
Public
A content processor can alter or transform the produced content during the generation process.
During generation the usage of a content processor instance comprises three steps:
During generation the usage of a content processor instance comprises three steps:
- The method
init(de.espirit.firstspirit.access.GenerationContext,java.io.OutputStream)
is called. - A writer is requested where the content is directed to (
getWriter()
). - The end of the content stream is signaled by a call to
finish()
.
- Since:
- 4.0.17
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
Called in case of failure to allow gracefully clean up (of resources, file handles, etc).void
finish()
This method is called after all content has been written and the writer fromgetWriter()
has beenclosed
.This method is called afterinit(de.espirit.firstspirit.access.GenerationContext,java.io.OutputStream)
.void
init
(GenerationContext gc, OutputStream out) Initializes the content processor.boolean
If during preview processing a content processor needs to access referenced media files the implementation must returntrue
.
-
Method Details
-
init
Initializes the content processor.- Parameters:
gc
- the generation contextout
- the output stream where the processed content should be directed to by this instance- Throws:
IOException
- Since:
- 4.0.17
-
getWriter
This method is called afterinit(de.espirit.firstspirit.access.GenerationContext,java.io.OutputStream)
.- Returns:
- the writer where the content is written to by the generation
- Throws:
IOException
- Since:
- 4.0.17
-
finish
This method is called after all content has been written and the writer fromgetWriter()
has beenclosed
.- Throws:
IOException
- Since:
- 4.0.17
-
cleanUp
void cleanUp()Called in case of failure to allow gracefully clean up (of resources, file handles, etc).- Since:
- 4.0.24
-
needsPrivilegedAccessToMediafiles
boolean needsPrivilegedAccessToMediafiles()If during preview processing a content processor needs to access referenced media files the implementation must returntrue
. Else every request to an media url will answered with the http error 403 (forbidden).- Since:
- 4.0.20
-