com.martiansoftware.jsap.stringparsers
Class InetAddressStringParser
java.lang.Object
com.martiansoftware.jsap.StringParser
com.martiansoftware.jsap.stringparsers.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
Method Summary |
Object |
parse(String arg)
Parses the specified argument into an InetAddress. |
InetAddressStringParser
public InetAddressStringParser()
- Creates a new InetAddressStringParser.
parse
public Object parse(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)
Copyright © 2002-2004, Martian Software, Inc.. All Rights Reserved.
For the latest version and documentation, please visit http://www.martiansoftware.com/jsap