private static List < PathMatcher > toMatchChain ( String path ) { String [ ] pieces = path . split ( PATH_SEPARATOR ) ; List < PathMatcher > matchers = new ArrayList < PathMatcher > ( ) ; for ( String piece : pieces ) { matchers . add ( ( piece . startsWith ( ":" ) ) ? new GreedyPathMatcher ( piece ) : new SimplePathMatcher ( piece ) ) ; } return Collections . unmodifiableList ( matchers ) ; }
converts a string path to a tree of heterogenous matchers