Skip to content

Expose some methods on Matcher functionality to make external usage easier. #276

Closed
@Claudenw

Description

@Claudenw

I am using modified MatchPattern, MatchPatterns and SelectorUtils in the new Apache Rat 0.17. I had to modify them because I needed visibility to the matching patterns, and because package private made some extensions impossible.

The changes to MatchPattern and MatchPatterns classes proposed below makes it possible to create Decorator classes that do what we need to do in Rat.

The changes to SelectorUtils ensures that we are reusing methods that will stay in sync with any changes to the internal algorithms of MatchPattern and to make display of some information easier.

So I would like to:

  • Add a public String source() method to MatchPattern to return the "source" instance value.
  • Make public MatchPattern method static String[] tokenizePathToString(String path, String separator)
  • Add public List<String> sources() method to MatchPatterns that to return a list of MatchPattern.source() for each enclosed pattern.
  • Make public SelectorUtils static boolean isAntPrefixedPattern() method
  • Make public SelectorUtils static boolean isRegexPrefixedPattern() method
  • Add a SelectorUtils public static String extractPattern(final string pattern, final String separator) method to extract a simplified pattern without the Ant or Regex prefix and with the Ant path modified by a call to toOSRelatedPath to ensure that it is properly formatted.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions