protected void checkIpv4Address(char[] value)
throws ValidationException
{
if (StringUtils.count(value, CONSTANT.DOT_CHAR) != 3)
throw new ValidationException(String.format(IP_MISSING_DOTS_MALFORMED, getName()));
List<char[]> octets = StringUtils.split(value, CONSTANT.DOT_CHAR);
if (octets.size() != 4)
throw new ValidationException(String.format(IP_MISSING_OCTET_MALFORMED, getName()));
for (char[] octet : octets)
{
String octetString = StringUtils.concat(octet);
// parse
try
{
StringUtils.parseUInt8(octetString);
}
catch(Throwable e)
{
throw new ValidationException(String.format(IP_OCTET_PROBLEM, getName()) + octetString);
}
}
}