Class URLStringParser
java.lang.Object
com.martiansoftware.jsap.StringParser
com.martiansoftware.jsap.stringparsers.URLStringParser
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URLStringParser
Returns aURLStringParser
.Parses the specified argument into a URL.Methods inherited from class com.martiansoftware.jsap.StringParser
setUp, tearDown
-
Constructor Details
-
URLStringParser
public URLStringParser()Deprecated.UsegetParser()
or, even better,JSAP.URL_PARSER
.Creates a new URLStringParser.
-
-
Method Details
-
getParser
Returns aURLStringParser
.Convenient access to the only instance returned by this method is available through
JSAP.URL_PARSER
.- Returns:
- a
URLStringParser
.
-
parse
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:
parse
in classStringParser
- Parameters:
arg
- the argument to parse- Returns:
- a URL as specified by arg.
- Throws:
ParseException
- ifnew URL(arg)
throws a MalformedURLException.- See Also:
-
getParser()
or, even better,JSAP.URL_PARSER
.