org.alfresco.repo.content.transform
Class StringExtractingContentTransformer
java.lang.Object
org.alfresco.repo.content.transform.ContentTransformerHelper
org.alfresco.repo.content.transform.AbstractContentTransformer2
org.alfresco.repo.content.transform.StringExtractingContentTransformer
- All Implemented Interfaces:
- ContentWorker, ContentTransformer
public class StringExtractingContentTransformer
- extends AbstractContentTransformer2
Converts any textual format to plain text.
The transformation is sensitive to the source and target string encodings.
Method Summary |
boolean |
isTransformable(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
Gives a high reliability for all translations from text/sometype to
text/plain. |
void |
transformInternal(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
Text to text conversions are done directly using the content reader and writer string
manipulation methods. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PREFIX_TEXT
public static final java.lang.String PREFIX_TEXT
- See Also:
- Constant Field Values
StringExtractingContentTransformer
public StringExtractingContentTransformer()
isTransformable
public boolean isTransformable(java.lang.String sourceMimetype,
java.lang.String targetMimetype,
TransformationOptions options)
- Gives a high reliability for all translations from text/sometype to
text/plain. As the text formats are already text, the characters
are preserved and no actual conversion takes place.
Extraction of text from binary data is wholly unreliable.
- Parameters:
sourceMimetype
- the source mimetypeoptions
- the transformation options
- Returns:
- boolean true if this content transformer can satify the mimetypes and options specified, false otherwise
transformInternal
public void transformInternal(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
throws java.lang.Exception
- Text to text conversions are done directly using the content reader and writer string
manipulation methods.
Extraction of text from binary content attempts to take the possible character
encoding into account. The text produced from this will, if the encoding was correct,
be unformatted but valid.
- Specified by:
transformInternal
in class AbstractContentTransformer2
- Parameters:
reader
- the source of the content to transformwriter
- the target to which to write the transformed contentoptions
- a map of options to use when performing the transformation. The map
will never be null.
- Throws:
java.lang.Exception
- exceptions will be handled by this class - subclasses can throw anything
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.