当前位置: 首页>>代码示例>>Java>>正文


Java InetAddressValidator.getInstance方法代码示例

本文整理汇总了Java中org.apache.commons.validator.routines.InetAddressValidator.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java InetAddressValidator.getInstance方法的具体用法?Java InetAddressValidator.getInstance怎么用?Java InetAddressValidator.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.commons.validator.routines.InetAddressValidator的用法示例。


在下文中一共展示了InetAddressValidator.getInstance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isValidIp4

import org.apache.commons.validator.routines.InetAddressValidator; //导入方法依赖的package包/类
public static boolean isValidIp4(final String ip) {
    if (ip == null) {
        return false;
    }

    final InetAddressValidator validator = InetAddressValidator.getInstance();
    return validator.isValidInet4Address(ip);
}
 
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:9,代码来源:NetUtils.java

示例2: isValidIp6

import org.apache.commons.validator.routines.InetAddressValidator; //导入方法依赖的package包/类
public static boolean isValidIp6(final String ip) {
    if (ip == null) {
        return false;
    }

    final InetAddressValidator validator = InetAddressValidator.getInstance();
    return validator.isValidInet6Address(ip);
}
 
开发者ID:MissionCriticalCloud,项目名称:cosmic,代码行数:9,代码来源:NetUtils.java

示例3: isValidDomain

import org.apache.commons.validator.routines.InetAddressValidator; //导入方法依赖的package包/类
/**
 * Returns true if the domain component of an email address is valid.
 * @param domain being validated.
 * @return true if the email address's domain is valid.
 */
protected boolean isValidDomain(String domain) {
    boolean symbolic = false;

    // see if domain is an IP address in brackets
    MatchResult ipDomainMatcher = IP_DOMAIN_PATTERN.exec(domain);

    if (ipDomainMatcher != null) {
        InetAddressValidator inetAddressValidator =
                InetAddressValidator.getInstance();
        if (inetAddressValidator.isValid(ipDomainMatcher.getGroup(1))) {
            return true;
        }
    } else {
        // Domain is symbolic name
        symbolic = (DOMAIN_PATTERN.exec(domain) != null);
    }

    if (symbolic) {
        if (!isValidSymbolicDomain(domain)) {
            return false;
        }
    } else {
        return false;
    }

    return true;
}
 
开发者ID:ManfredTremmel,项目名称:gwt-commons-validator,代码行数:33,代码来源:EmailValidator.java

示例4: isValidIp4

import org.apache.commons.validator.routines.InetAddressValidator; //导入方法依赖的package包/类
public static boolean isValidIp4(final String ip) {
    if (ip == null)
        return false;

    final InetAddressValidator validator = InetAddressValidator.getInstance();
    return validator.isValidInet4Address(ip);
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:8,代码来源:NetUtils.java

示例5: isValidIp6

import org.apache.commons.validator.routines.InetAddressValidator; //导入方法依赖的package包/类
public static boolean isValidIp6(final String ip) {
    if (ip == null)
        return  false;

    final InetAddressValidator validator = InetAddressValidator.getInstance();
    return validator.isValidInet6Address(ip);
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:8,代码来源:NetUtils.java

示例6: createArgs

import org.apache.commons.validator.routines.InetAddressValidator; //导入方法依赖的package包/类
@Override protected ImmutableList<String> createArgs() {
    List<String> argList = new ArrayList<>();
    checkAppiumJS();
    argList.add(appiumJS.getAbsolutePath());
    argList.add("--port");
    argList.add(String.valueOf(getPort()));

    if (StringUtils.isBlank(ipAddress)) {
        ipAddress = DEFAULT_LOCAL_IP_ADDRESS;
    } else {
        InetAddressValidator validator = InetAddressValidator.getInstance();
        if (!validator.isValid(ipAddress) && !validator.isValidInet4Address(ipAddress)
            && !validator.isValidInet6Address(ipAddress)) {
            throw new IllegalArgumentException(
                    "The invalid IP address " + ipAddress + " is defined");
        }
    }
    argList.add("--address");
    argList.add(ipAddress);

    File log = getLogFile();
    if (log != null) {
        argList.add("--log");
        argList.add(log.getAbsolutePath());
    }

    Set<Map.Entry<String, String>> entries = serverArguments.entrySet();
    for (Map.Entry<String, String> entry : entries) {
        String argument = entry.getKey();
        String value = entry.getValue();
        if (StringUtils.isBlank(argument) || value == null) {
            continue;
        }

        argList.add(argument);
        if (!StringUtils.isBlank(value)) {
            argList.add(value);
        }
    }

    if (capabilities != null) {
        argList.add("--default-capabilities");
        argList.add(parseCapabilities());
    }

    return new ImmutableList.Builder<String>().addAll(argList).build();
}
 
开发者ID:JoeUtt,项目名称:menggeqa,代码行数:48,代码来源:AppiumServiceBuilder.java

示例7: matches

import org.apache.commons.validator.routines.InetAddressValidator; //导入方法依赖的package包/类
@Override
public boolean matches(String value) {
    InetAddressValidator validator = InetAddressValidator.getInstance();
    return validator.isValid(value);
}
 
开发者ID:arx-deidentifier,项目名称:arx,代码行数:6,代码来源:HIPAAMatcherAttributeValue.java


注:本文中的org.apache.commons.validator.routines.InetAddressValidator.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。