Class RegexpPatternMatcher.RegexpMatcher

  • All Implemented Interfaces:
    Matcher
    Enclosing class:
    RegexpPatternMatcher

    private static class RegexpPatternMatcher.RegexpMatcher
    extends java.lang.Object
    implements Matcher
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Boolean exact  
      private java.lang.String expression  
      private java.util.regex.Pattern pattern  
    • Constructor Summary

      Constructors 
      Constructor Description
      RegexpMatcher​(java.lang.String expression)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.Boolean calculateExact()  
      boolean isExact()
      Return if the matcher will match *only* if the expression equals the input.
      boolean matches​(java.lang.String input)
      Check whether a given string is matched by this matcher.
      • Methods inherited from class java.lang.Object

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

      • pattern

        private java.util.regex.Pattern pattern
      • expression

        private java.lang.String expression
      • exact

        private java.lang.Boolean exact
    • Constructor Detail

      • RegexpMatcher

        public RegexpMatcher​(java.lang.String expression)
                      throws java.util.regex.PatternSyntaxException
        Throws:
        java.util.regex.PatternSyntaxException
    • Method Detail

      • matches

        public boolean matches​(java.lang.String input)
        Description copied from interface: Matcher
        Check whether a given string is matched by this matcher.
        Specified by:
        matches in interface Matcher
        Parameters:
        input - the string to be matched. Cannot be null.
        Returns:
        true if the input string is matched, false otherwise.
      • isExact

        public boolean isExact()
        Description copied from interface: Matcher
        Return if the matcher will match *only* if the expression equals the input. WARN: This is used only as a performance trick, to avoid scanning for things when you already know exactly what you want. In the install task where it used it avoid scanning the repository to list all modules to find that only one matches, and that it has the name requested.
        Specified by:
        isExact in interface Matcher
        Returns:
        true if the matcher only matches when the expression is equals to the input, false otherwise.
      • calculateExact

        private java.lang.Boolean calculateExact()