org.springframework.beandoc.util
Class PatternMatcher
java.lang.Object
org.springframework.beandoc.util.PatternMatcher
public final class PatternMatcher
- extends Object
Utility class that matches bean names/id's or class names against an array of
regex Pattern
s, using a callback interface for each pattern in the
array which matched.
- Since:
- 1.0
- Author:
- Darren Davison
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PatternMatcher
protected PatternMatcher()
convertStringsToPatterns
public static Pattern[] convertStringsToPatterns(Collection strings)
- Convert a collection of String objects to an array of compiled
regex Patterns. Gaps in the collection or objects that aren't
Strings will simply be ignored.
- Parameters:
strings
- a List of Strings
- Returns:
- an array of compiled Patterns
matchPatterns
public static void matchPatterns(Pattern[] patterns,
String[] testStrings,
MatchedPatternCallback callback)
- Takes an array of Patterns, the id/name and f.q.class name of a bean and a callback interface. For
each pattern in the array that matches the bean id/name or class, the callback is executed passing in
the String representation of the matching pattern and its index in the original array.
- Parameters:
patterns
- an array of compiled Pattern
stestStrings
- the array of Strings to test against the patterns. Usually consists of
the id/name of the bean and its fully qualified classnamecallback
- an implementation of MatchedPatternCallback
Copyright © 2004-2011 Spring BeanDoc. All Rights Reserved.