Class MCRContentTransformer
java.lang.Object
org.mycore.common.content.transformer.MCRContentTransformer
- Direct Known Subclasses:
MCRBibTeX2MODSTransformer
,MCRBibUtilsTransformer
,MCRCSLJSONTransformer
,MCRDebuggingTransformer
,MCRFopper
,MCRHTML2XHTMLContentTransformer
,MCRIdentityTransformer
,MCRParameterizedTransformer
,MCRToJSONTransformer
,MCRToPrettyXML
,MCRXHTML2PDFTransformer
Subclasses of MCRContentTransformer implement different methods
to transform MCRContent. They may have their own additional
configuration properties. Every transformer instance has a unique ID.
The implementing class is configured using the property
MCR.ContentTransformer.{ID}.Class
Optionally, a transformer can set its returning MIME Type via
MCR.ContentTransformer.{ID}.MIMEType
- Author:
- Frank Lützenkirchen
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected String
Returns the encoding of characters in the binary stream.Returns the file extension that is usually related to the transformed content.Returns the MIME type of the transformed content, may return the default mime typevoid
Called by the factory to initialize configuration of this transformerabstract MCRContent
transform
(MCRContent source) Transforms MCRContent.void
transform
(MCRContent source, OutputStream out)
-
Field Details
-
mimeType
The MIME type of the output generated by this transformer -
fileExtension
-
contentDisposition
-
DEFAULT_CONTENT_DISPOSITION
- See Also:
-
-
Constructor Details
-
MCRContentTransformer
public MCRContentTransformer()
-
-
Method Details
-
init
Called by the factory to initialize configuration of this transformer -
transform
Transforms MCRContent. Subclasses implement different transformation methods- Throws:
IOException
-
transform
- Throws:
IOException
-
getMimeType
Returns the MIME type of the transformed content, may return the default mime type- Throws:
Exception
-
getEncoding
Returns the encoding of characters in the binary stream. Will return null if the encoding is unknown or the results does not represent character data.- Throws:
Exception
-
getFileExtension
Returns the file extension that is usually related to the transformed content.- Throws:
Exception
-
getContentDisposition
-
getDefaultExtension
-
getDefaultMimeType
-