What exactly is UriParserFactory supposed to do?
I mean I guess it should return a Parser, but what exactly does a UriParser look like?

UriParserFactory is a factory class: A class used to create instances of other classes, UriParser to be precise.

The parser is specified (on the programming site) via the UriParser interface in UriParser.java.
A parser has to implement this interface which requires a parse method that returns a URI.

so does the ParserFactory just call ParserImplementation?

Depending on your implementation, yes.
Also, think about edge cases (see your test cases).

1 Like


okay sorry not done yet :smiley:
If I try to do something like “return UriParserImplementation()”, it tells me, that the method is undefined for type ParserFactory, same with UriImplementation.
Both are imported, and I guess I need them to create my Parser

Java uses the new keyword to create class instances:
Subsection 8.4.1: Constructors

1 Like

ouh yeah okay might have known this.
THanks a lot