- Removed
WebURLgetRawUsernameOrEmpty(),getRawPasswordOrEmpty(),getRawQueryOrEmpty(), andgetRawFragmentOrEmpty(). Use the nullable Java-style raw getters or the null-free WHATWG-style getters instead. - Removed
WebURL.Builder.setRawHost(). UsesetHost()for URL Standard host input parsing. WebURL.Buildernow defers parsing-context validation untilbuild(), while setters still reject basic scheme and port argument errors.
- Added WHATWG-style
WebURLcomponent getters:getWebProtocol(),getWebUsername(),getWebPassword(),getWebHost(),getWebHostname(),getWebPort(),getWebPathname(),getWebSearch(), andgetWebHash(). - Added parser-aware
WebURLParser.toURI(String)andWebURLParser.toURL(String)conversion helpers. - Added
org.glavo.url.pattern.WebURLPattern,WebURLPatternParser, andWebURLPatternSyntaxExceptionfor precompiled WHATWG URLPattern-style matching from shorthand strings or component builders.
WebURL.getPort()now returns the default port for known schemes (http,https,ws,wss,ftp) when no port is explicitly written. Use the newWebURL.getRawPort()to get the raw port component as written, ornullif absent.- Removed nested subclasses of
WebURLParseException(e.g.PortInvalid,HostMissing). UseWebURLParseException.getErrorType()with the newErrorTypeenum constants instead. - Renamed
WebURLParseException.errorName()togetErrorName(). WebURL.toURI()now throwsURISyntaxExceptionwhen the URL has no JavaURIrepresentation. The staticWebURL.toURI(String)helper reports the same conversion failure asIllegalArgumentException, notIllegalStateException, whileWebURL.toURL()continues to throwMalformedURLExceptionfor URI conversion and URL handler failures.WebURL.toURL(String)now reports URL parsing failures asMalformedURLException, preserving theWebURLParseExceptionas the cause.
WebURL.resolve(String)— resolves an absolute or relative URL string against this URL.WebURL.newBuilder()andWebURL.newBuilder(WebURL)— create mutableWebURL.Builderinstances for constructing URLs from components or copying and modifying an existing URL.WebURL.getRawPort()— returns the port component as written, ornullif absent.WebURL.parseBrowserInputToURI(String)andWebURL.parseBrowserInputToURL(String)— parse browser-style user input and convert the result directly to Java networking types.WebURLParser— a reusable parser interface with two built-in instances:WebURLParser.getDefault()— lenient parser that accepts recoverable validation errors (previous behavior).WebURLParser.getStrict()— strict parser that rejects recoverable validation errors.
WebURLParseException.ErrorType— enum covering every URL Standard validation error type, with a standard error name, a human-readable reason, and a flag indicating whether the error is recoverable.WebURLParseExceptionnow records the input string, a reason, and the character index of the error, similar tojava.net.URISyntaxException.
- Fixed fast-path parsing of URLs with empty password markers such as
https://user:@example.com/, ensuring they normalize consistently with the full WHATWG parser and remain stable when copied throughWebURL.Builder.
- Reduced memory allocations in URL host parsing, IDNA processing, and percent-encoding paths.
- Expanded Javadoc for
WebURL,WebURLParser,WebURLParseException, andErrorType. - Expanded README with a Quick Start guide and additional usage examples.
Initial release.