public Detector getDetector() {
        //be as lazy as possible and cache
        Detector localDetector = context.get(Detector.class);
        if (localDetector != null) {
            return localDetector;
        }
        if (detector != null) {
            return detector;
        }

        detector = getTikaConfig().getDetector();
        return detector;
    }
Utility function to get the Parser that was sent in to the
ParseContext to handle embedded documents.  If it is stateful,
unwrap it to get its stateless delegating parser.
<p>
If there is no Parser in the parser context, this will return null.

@param context
@return
tika-core/src/main/java/org/apache/tika/extractor/EmbeddedDocumentUtil.java