Class SourceCodeParser

java.lang.Object
org.apache.tika.parser.AbstractEncodingDetectorParser
org.apache.tika.parser.code.SourceCodeParser
All Implemented Interfaces:
Serializable, org.apache.tika.parser.Parser

public class SourceCodeParser extends org.apache.tika.parser.AbstractEncodingDetectorParser
Generic Source code parser for Java, Groovy, C++. Aware: This parser uses JHightlight library (https://github.com/codelibs/jhighlight) under CDDL/LGPL dual license
Since:
1.6
Author:
Hong-Thai.Nguyen
See Also:
  • Constructor Details

    • SourceCodeParser

      public SourceCodeParser()
    • SourceCodeParser

      public SourceCodeParser(org.apache.tika.detect.EncodingDetector encodingDetector)
  • Method Details

    • getSupportedTypes

      public Set<org.apache.tika.mime.MediaType> getSupportedTypes(org.apache.tika.parser.ParseContext context)
    • parse

      public void parse(InputStream stream, ContentHandler handler, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext context) throws IOException, SAXException, org.apache.tika.exception.TikaException
      Throws:
      IOException
      SAXException
      org.apache.tika.exception.TikaException