org.apache.clerezza.uima.metadatagenerator.mediatype
Class PlainTextExtractor
java.lang.Object
org.apache.clerezza.uima.metadatagenerator.mediatype.PlainTextExtractor
- All Implemented Interfaces:
- MediaTypeTextExtractor
public class PlainTextExtractor
- extends Object
- implements MediaTypeTextExtractor
Base implementation of MediaType
|
Method Summary |
String |
extract(byte[] bytes)
Extract the text from the provided input if its Media Type is supported. |
boolean |
supports(javax.ws.rs.core.MediaType mediaType)
Check if the provided MediaType is supported by this extractor. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PlainTextExtractor
public PlainTextExtractor()
supports
public boolean supports(javax.ws.rs.core.MediaType mediaType)
- Check if the provided
MediaType is supported by this extractor.
- Specified by:
supports in interface MediaTypeTextExtractor
- Parameters:
mediaType - to be checked.
- Returns:
true if the provided MediaType as input is supported.
extract
public String extract(byte[] bytes)
throws UnsupportedMediaTypeException
- Extract the text from the provided input if its Media Type is supported.
- Specified by:
extract in interface MediaTypeTextExtractor
- Parameters:
bytes - an array of byte representing the input.
- Returns:
- a
String with the extracted text.
- Throws:
UnsupportedMediaTypeException - if the input implicit Media type is not supported.
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.