Class PoliPatternManager

    • Constructor Summary

      Constructors 
      Constructor Description
      PoliPatternManager​(java.io.InputStream s, java.lang.String n)  
    • Method Summary

      Modifier and Type Method Description
      PoliMatch create_match​(java.lang.String pattern_id, java.lang.String matchtext, java.util.Map<java.lang.String,​java.lang.String> groups)
      Deprecated.
      logic for creation of a match is back in main PoLi match loop
      protected RegexPattern create_pattern​(java.lang.String fam, java.lang.String rule, java.lang.String desc)
      Pattern Factory Implementation must create a RegexPattern given the basic RULE define, #RULE FAMILY RID REGEX PatternManager here adds compiled pattern and DEFINES.
      protected PatternTestCase create_testcase​(java.lang.String id, java.lang.String fam, java.lang.String text)
      Implementation must create TestCases given the #TEST directive, #TEST RID TID TEXT
      void disable_patterns​(java.lang.String fam)
      Enable a family of patterns
      void enable_pattern​(RegexPattern repat)
      enable an instance of a pattern based on the global settings.
      void enable_patterns​(java.lang.String fam)
      default adapter -- you must override.
      void enableAll()
      You don't really want to enable All patterns...
      protected boolean validate_pattern​(RegexPattern repat)
      Implementation has the option to check a pattern; For now invalid patterns are only logged.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PoliPatternManager

        public PoliPatternManager​(java.io.InputStream s,
                                  java.lang.String n)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • disable_patterns

        public void disable_patterns​(java.lang.String fam)
        Enable a family of patterns
        Parameters:
        fam - pat family to disable
      • enableAll

        public void enableAll()
        You don't really want to enable All patterns... unless you are brute force testing all your patterns.
        Overrides:
        enableAll in class RegexPatternManager
      • enable_patterns

        public void enable_patterns​(java.lang.String fam)
        Description copied from class: RegexPatternManager
        default adapter -- you must override. This should be abstract, but not all pattern managers are required to support this.
        Overrides:
        enable_patterns in class RegexPatternManager
        Parameters:
        fam - pattern name to enable.
      • enable_pattern

        public void enable_pattern​(RegexPattern repat)
        enable an instance of a pattern based on the global settings.
        Specified by:
        enable_pattern in class RegexPatternManager
        Parameters:
        repat - regex pattern
      • create_pattern

        protected RegexPattern create_pattern​(java.lang.String fam,
                                              java.lang.String rule,
                                              java.lang.String desc)
        Pattern Factory Implementation must create a RegexPattern given the basic RULE define, #RULE FAMILY RID REGEX PatternManager here adds compiled pattern and DEFINES.
        Specified by:
        create_pattern in class RegexPatternManager
        Parameters:
        fam - pattern family
        rule - pattern rule ID
        desc - optional description
        Returns:
        flexpat pattern
      • validate_pattern

        protected boolean validate_pattern​(RegexPattern repat)
        Implementation has the option to check a pattern; For now invalid patterns are only logged. All patterns in config file are valid. Override this as needed.
        Specified by:
        validate_pattern in class RegexPatternManager
        Parameters:
        repat - pattern object
        Returns:
        true if pattern is valid
      • create_testcase

        protected PatternTestCase create_testcase​(java.lang.String id,
                                                  java.lang.String fam,
                                                  java.lang.String text)
        Implementation must create TestCases given the #TEST directive, #TEST RID TID TEXT
        Specified by:
        create_testcase in class RegexPatternManager
        Parameters:
        id - test ID
        text - text for test
        fam - pattern family to test
        Returns:
        test case
      • create_match

        @Deprecated
        public PoliMatch create_match​(java.lang.String pattern_id,
                                      java.lang.String matchtext,
                                      java.util.Map<java.lang.String,​java.lang.String> groups)
        Deprecated.
        logic for creation of a match is back in main PoLi match loop
        The match object is normalized, setting the coord_text and other data from parsing "text" and knowing which pattern family was matched.
        Parameters:
        pattern_id - the pattern_id
        matchtext - the matchtext
        groups - the groups
        Returns:
        the poli match