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 URLStringParserReturns aURLStringParser.Parses the specified argument into a URL.Methods inherited from class 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:
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:
-
getParser()or, even better,JSAP.URL_PARSER.