Class RuleMatchesAsJsonSerializer


  • public class RuleMatchesAsJsonSerializer
    extends Object
    Write rule matches and some meta information as JSON.
    Since:
    3.4, public since 3.6
    • Constructor Detail

      • RuleMatchesAsJsonSerializer

        public RuleMatchesAsJsonSerializer()
      • RuleMatchesAsJsonSerializer

        public RuleMatchesAsJsonSerializer​(int compactMode)
        Since:
        4.7
    • Method Detail

      • ruleMatchesToJson

        public String ruleMatchesToJson​(List<RuleMatch> matches,
                                        List<RuleMatch> hiddenMatches,
                                        String text,
                                        int contextSize,
                                        DetectedLanguage detectedLang,
                                        String incompleteResultsReason)
        Parameters:
        incompleteResultsReason - use a string that explains why results are incomplete (e.g. due to a timeout) - a 'warnings' section will be added to the JSON. Use null if results are complete.
        Since:
        3.7
      • ruleMatchesToJson

        public String ruleMatchesToJson​(List<RuleMatch> matches,
                                        List<RuleMatch> hiddenMatches,
                                        AnnotatedText text,
                                        int contextSize,
                                        DetectedLanguage detectedLang,
                                        String incompleteResultsReason)
        Parameters:
        incompleteResultsReason - use a string that explains why results are incomplete (e.g. due to a timeout) - a 'warnings' section will be added to the JSON. Use null if results are complete.
        Since:
        4.3