org.tinygroup.weblayer.util
类 TinyPathMatcher
java.lang.Object
org.tinygroup.weblayer.util.TinyPathMatcher
public class TinyPathMatcher
- extends Object
功能说明:
系统版本: v1.0
开发人员: renhui
开发时间: 2013-5-15
功能描述: 写明作用,调用方式,使用场景,以及特殊情况
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TinyPathMatcher
public TinyPathMatcher()
combine
public String combine(String pattern1,
String pattern2)
- Combines two patterns into a new pattern that is returned.
This implementation simply concatenates the two patterns, unless the first pattern
contains a file extension match (such as *.html. In that case, the second pattern
should be included in the first, or an IllegalArgumentException is thrown.
For example:
| Pattern 1 | Pattern 2 | Result |
| /hotels | null | /hotels |
null | /hotels | /hotels |
| /hotels | /bookings | /hotels/bookings |
| /hotels | bookings | /hotels/bookings |
| /hotels/* | /bookings | /hotels/bookings |
| /hotels/** | /bookings | /hotels/**/bookings |
| /hotels | {hotel} | /hotels/{hotel} |
| /hotels/* | {hotel} | /hotels/{hotel} |
| /hotels/** | {hotel} | /hotels/**/{hotel} |
| /*.html | /hotels.html | /hotels.html |
| /*.html | /hotels | /hotels.html |
| /*.html | /*.txt | IllegalArgumentException |
- 参数:
pattern1 - the first patternpattern2 - the second pattern
- 返回:
- the combination of the two patterns
- 抛出:
IllegalArgumentException - when the two patterns cannot be combined
Copyright © 2006–2014 开源组织. All rights reserved.