@Contract(threading=SAFE) public final class PublicSuffixMatcher extends Object
可以从publicsuffix.org获得最新的后缀列表
PublicSuffixList
| Constructor and Description |
|---|
PublicSuffixMatcher(Collection<PublicSuffixList> lists) |
PublicSuffixMatcher(Collection<String> rules, Collection<String> exceptions) |
PublicSuffixMatcher(DomainType domainType, Collection<String> rules, Collection<String> exceptions) |
| Modifier and Type | Method and Description |
|---|---|
String |
getDomainRoot(String domain)
如果给定域代表公共后缀,则返回给定域名的域的可注册部分,或
null 。
|
String |
getDomainRoot(String domain, DomainType expectedType)
返回给定域名的域的可注册部分,如果给定域代表公共后缀,
null 。
|
boolean |
matches(String domain)
测试给定的域是否匹配公共后缀列表中的任何条目。
|
boolean |
matches(String domain, DomainType expectedType)
测试给定的域是否匹配公共后缀列表中的任何条目。
|
public PublicSuffixMatcher(Collection<String> rules, Collection<String> exceptions)
public PublicSuffixMatcher(DomainType domainType, Collection<String> rules, Collection<String> exceptions)
public PublicSuffixMatcher(Collection<PublicSuffixList> lists)
public String getDomainRoot(String domain)
null 。
domain -
public String getDomainRoot(String domain, DomainType expectedType)
null 。
domain -
expectedType - 预期域类型或
null如果有)。
public boolean matches(String domain)
public boolean matches(String domain, DomainType expectedType)
domain -
expectedType - 预期域类型或
null如果有)。
true如果给定的域匹配任何公共后缀。
Copyright © 1999–2017 The Apache Software Foundation. All rights reserved.