Class 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 Detail

      • URLStringParser

        public URLStringParser()
        Deprecated.
        Use getParser() or, even better, JSAP.URL_PARSER.
        Creates a new URLStringParser.
    • Method Detail

      • parse

        public java.lang.Object parse​(java.lang.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)