- java.lang.Object
-
- inet.ipaddr.format.validate.Validator
-
- All Implemented Interfaces:
HostIdentifierStringValidator
public class Validator extends java.lang.Object implements HostIdentifierStringValidator
Validates host strings, address strings, and prefix lengths.- Author:
- sfoley
-
-
Field Summary
Fields Modifier and Type Field Description static HostIdentifierStringValidatorVALIDATOR-
Fields inherited from interface inet.ipaddr.format.validate.HostIdentifierStringValidator
IPvFUTURE, MAX_PREFIX, MAX_PREFIX_CHARS, SMTP_IPV6_IDENTIFIER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanisReserved(char c)IPAddressProvidervalidateAddress(IPAddressString fromString)MACAddressProvidervalidateAddress(MACAddressString fromString)ParsedHostvalidateHost(HostName fromHost)ParsedHostvalidateHostName(HostName fromHost)IPAddressProvidervalidateIPAddressStr(IPAddressString fromString)MACAddressProvidervalidateMACAddressStr(MACAddressString fromString)intvalidatePrefix(java.lang.CharSequence fullAddr, IPAddress.IPVersion version)intvalidatePrefixLenString(java.lang.CharSequence fullAddr, IPAddress.IPVersion version)static intvalidateZone(java.lang.CharSequence zone)Returns the index of the first invalid character of the zone, or -1 if the zone is valid
-
-
-
Field Detail
-
VALIDATOR
public static final HostIdentifierStringValidator VALIDATOR
-
-
Method Detail
-
validateAddress
public IPAddressProvider validateAddress(IPAddressString fromString) throws AddressStringException
- Specified by:
validateAddressin interfaceHostIdentifierStringValidator- 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(java.lang.CharSequence fullAddr, IPAddress.IPVersion version) throws AddressStringException- Specified by:
validatePrefixin interfaceHostIdentifierStringValidator- Throws:
AddressStringException
-
validatePrefixLenString
public int validatePrefixLenString(java.lang.CharSequence fullAddr, IPAddress.IPVersion version) throws AddressStringException- Throws:
AddressStringException
-
validateZone
public static int validateZone(java.lang.CharSequence zone)
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
public ParsedHost validateHost(HostName fromHost) throws HostNameException
- Specified by:
validateHostin interfaceHostIdentifierStringValidator- Throws:
HostNameException
-
validateHostName
public ParsedHost validateHostName(HostName fromHost) throws HostNameException
- Throws:
HostNameException
-
-