Class InetAddressStringParser


  • public class InetAddressStringParser
    extends StringParser
    A StringParser for parsing java.net.InetAddress objects. The parse() method delegates the actual parsing to InetAddress.getByName(String). If InetAddress.getByName() throws an UnknownHostException, it is encapsulated in a ParseException and re-thrown.
    Author:
    Marty Lamb
    See Also:
    StringParser, InetAddress
    • Constructor Detail

    • Method Detail

      • parse

        public java.lang.Object parse​(java.lang.String arg)
                               throws ParseException
        Parses the specified argument into an InetAddress. This method delegates the actual parsing to InetAddress.getByName(arg). If InetAddress.getByName(arg) throws an UnknownHostException, it is encapsulated in a ParseException and re-thrown.
        Specified by:
        parse in class StringParser
        Parameters:
        arg - the argument to parse
        Returns:
        an InetAddress object representing the specified address.
        Throws:
        ParseException - if InetAddress.getByName(arg) throws an UnknownHostException.
        See Also:
        InetAddress, StringParser.parse(String)