Class URLStringParser
- java.lang.Object
-
- com.martiansoftware.jsap.StringParser
-
- com.martiansoftware.jsap.stringparsers.URLStringParser
-
public class URLStringParser extends StringParser
AStringParserfor parsing java.net.URL objects. The parse() method delegates the actual parsing tonew URL(String). Ifnew URL()throws a MalformedURLException, it is encapsulated in a ParseException and re-thrown.- Author:
- Marty Lamb
- See Also:
StringParser,URL
-
-
Constructor Summary
Constructors Constructor Description URLStringParser()Deprecated.UsegetParser()or, even better,JSAP.URL_PARSER.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static URLStringParsergetParser()Returns aURLStringParser.Objectparse(String arg)Parses the specified argument into a URL.-
Methods inherited from class com.martiansoftware.jsap.StringParser
setUp, tearDown
-
-
-
-
Constructor Detail
-
URLStringParser
public URLStringParser()
Deprecated.UsegetParser()or, even better,JSAP.URL_PARSER.Creates a new URLStringParser.
-
-
Method Detail
-
getParser
public static URLStringParser getParser()
Returns aURLStringParser.Convenient access to the only instance returned by this method is available through
JSAP.URL_PARSER.- Returns:
- a
URLStringParser.
-
parse
public Object parse(String arg) throws ParseException
Parses the specified argument into a URL. This method delegates the actual parsing tonew URL(arg). Ifnew URL(arg)throws a MalformedURLException, it is encapsulated in a ParseException and re-thrown.- Specified by:
parsein classStringParser- Parameters:
arg- the argument to parse- Returns:
- a URL as specified by arg.
- Throws:
ParseException- ifnew URL(arg)throws a MalformedURLException.- See Also:
URL,StringParser.parse(String)
-
-