Class Validator
java.lang.Object
inet.ipaddr.format.validate.Validator
- All Implemented Interfaces:
HostIdentifierStringValidator
Validates host strings, address strings, and prefix lengths.
- Author:
- sfoley
-
Field Summary
FieldsFields inherited from interface HostIdentifierStringValidator
IPvFUTURE, MAX_PREFIX, MAX_PREFIX_CHARS, SMTP_IPV6_IDENTIFIER -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisReserved(char c) validateAddress(IPAddressString fromString) validateAddress(MACAddressString fromString) validateHost(HostName fromHost) validateHostName(HostName fromHost) validateIPAddressStr(IPAddressString fromString) validateMACAddressStr(MACAddressString fromString) intvalidatePrefix(CharSequence fullAddr, IPAddress.IPVersion version) intvalidatePrefixLenString(CharSequence fullAddr, IPAddress.IPVersion version) static intvalidateZone(CharSequence zone) Returns the index of the first invalid character of the zone, or -1 if the zone is valid
-
Field Details
-
VALIDATOR
-
-
Method Details
-
validateAddress
- Specified by:
validateAddressin interfaceHostIdentifierStringValidator- Parameters:
fromString-- Returns:
- Throws:
AddressStringException
-
validateIPAddressStr
public IPAddressProvider validateIPAddressStr(IPAddressString fromString) throws AddressStringException - Throws:
AddressStringException
-
validateAddress
public MACAddressProvider validateAddress(MACAddressString fromString) throws AddressStringException - Specified by:
validateAddressin interfaceHostIdentifierStringValidator- Throws:
AddressStringException
-
validateMACAddressStr
public MACAddressProvider validateMACAddressStr(MACAddressString fromString) throws AddressStringException - Throws:
AddressStringException
-
validatePrefix
public int validatePrefix(CharSequence fullAddr, IPAddress.IPVersion version) throws AddressStringException - Specified by:
validatePrefixin interfaceHostIdentifierStringValidator- Throws:
AddressStringException
-
validatePrefixLenString
public int validatePrefixLenString(CharSequence fullAddr, IPAddress.IPVersion version) throws AddressStringException - Throws:
AddressStringException
-
validateZone
Returns the index of the first invalid character of the zone, or -1 if the zone is valid- Parameters:
sequence-- Returns:
-
isReserved
public static boolean isReserved(char c) -
validateHost
- Specified by:
validateHostin interfaceHostIdentifierStringValidator- Throws:
HostNameException
-
validateHostName
- Throws:
HostNameException
-