Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Claudenw opened this issue Oct 19, 2024 · 0 comments
Closed

Comments

@Claudenw
Copy link
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants