Class BaseRegExp

    • Field Detail

      • m_Pattern

        protected Pattern m_Pattern
        for performing pattern matching.
    • Constructor Detail

      • BaseRegExp

        public BaseRegExp()
        Initializes the string with length 0.
      • BaseRegExp

        public BaseRegExp​(String s)
        Initializes the object with the string to parse.
        Parameters:
        s - the string to parse
    • Method Detail

      • isValid

        public boolean isValid​(String value)
        Checks whether the string value is a valid presentation for this class.
        Overrides:
        isValid in class AbstractBaseString
        Parameters:
        value - the string value to check
        Returns:
        always true
      • convert

        protected String convert​(String value)
        Converts the string according to the specified conversion.

        Implementation performs no conversion, merely initializes the pattern matcher.
        Overrides:
        convert in class AbstractBaseString
        Parameters:
        value - the string to convert
        Returns:
        the converted string
        See Also:
        m_Pattern
      • patternValue

        public Pattern patternValue()
        Returns the expression as compiled pattern.
        Returns:
        the pattern
      • getTipText

        public String getTipText()
        Returns a tool tip for the GUI editor (ignored if null is returned).
        Specified by:
        getTipText in class AbstractBaseString
        Returns:
        the tool tip
      • isMatch

        public boolean isMatch​(String s)
        Checks whether the string matches the regular expression.
        Parameters:
        s - the string to check against regexp
        Returns:
        true if the string matches the regexp
      • isMatchAll

        public boolean isMatchAll()
        Checks whether the expression is the match-all expression.
        Returns:
        true if the match-all expression
      • isEmpty

        public boolean isEmpty()
        Checks whether the expression empty.
        Overrides:
        isEmpty in class AbstractBaseString
        Returns:
        true if empty expression
      • escape

        public static String escape​(String s)
        Escapes special characters in the string to be used in regular expressions. Characters escaped with backslash: \|.?()[]
        Parameters:
        s - the string to escape
        Returns:
        the escaped string
      • listToRegExp

        public static BaseRegExp listToRegExp​(List<String> values)
        Turns the list of values into a regular expression of the format: "^(value1|value2|...)$".
        Parameters:
        values - the list to convert
        Returns:
        the regular expression
      • getHelpURL

        public String getHelpURL()
        Returns a URL with additional information.
        Specified by:
        getHelpURL in interface HelpProvider
        Returns:
        the URL, null if not available
      • getHelpDescription

        public String getHelpDescription()
        Returns a long help description, e.g., used in tiptexts.
        Specified by:
        getHelpDescription in interface HelpProvider
        Returns:
        the help text, null if not available
      • getHelpTitle

        public String getHelpTitle()
        Returns a short title for the help, e.g., used for buttons.
        Specified by:
        getHelpTitle in interface HelpProvider
        Returns:
        the short title, null if not available
      • getHelpIcon

        public String getHelpIcon()
        Returns the name of a help icon, e.g., used for buttons.
        Specified by:
        getHelpIcon in interface HelpProvider
        Returns:
        the icon name, null if not available