com.martiansoftware.jsap.stringparsers
Class URLStringParser

java.lang.Object
  extended bycom.martiansoftware.jsap.StringParser
      extended bycom.martiansoftware.jsap.stringparsers.URLStringParser

public class URLStringParser
extends StringParser

A StringParser for parsing java.net.URL objects. The parse() method delegates the actual parsing to new URL(String). If new URL() throws a MalformedURLException, it is encapsulated in a ParseException and re-thrown.

Author:
Marty Lamb
See Also:
StringParser, URL

Constructor Summary
URLStringParser()
          Creates a new URLStringParser.
 
Method Summary
 Object parse(String arg)
          Parses the specified argument into a URL.
 
Methods inherited from class com.martiansoftware.jsap.StringParser
setUp, tearDown
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLStringParser

public URLStringParser()
Creates a new URLStringParser.

Method Detail

parse

public Object parse(String arg)
             throws ParseException
Parses the specified argument into a URL. This method delegates the actual parsing to new URL(arg). If new URL(arg) throws a MalformedURLException, it is encapsulated in a ParseException and re-thrown.

Specified by:
parse in class StringParser
Parameters:
arg - the argument to parse
Returns:
a URL as specified by arg.
Throws:
ParseException - if new URL(arg) throws a MalformedURLException.
See Also:
URL, 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