In the Router class, the vert.x framework has such a constructor and method:
public class Router { final io.vertx.ext.web.Router delegate; public Router(io.vertx.ext.web.Router delegate) { this.delegate = delegate; } public Object getDelegate() { return delegate; } /** * Create a router * @param vertx the Vert.x instance * @return the router */ public static Router router(Vertx vertx) { Router ret= Router.newInstance(io.vertx.ext.web.Router.router((io.vertx.core.Vertx) vertx.getDelegate())); return ret; } in the line it is not clear what is happening:
newInstance(io.vertx.ext.web.Router.router((io.vertx.core.Vertx) vertx.getDelegate())); rather, the result is roughly clear — it takes the vertex instance delegate. But how does this happen and which instance does it take?
io.vertx.ext.web.Router io.vertx.core.Vertx these lines are the connection of the class packages vert.x core and vert.x web. I have never encountered such a syntax before (so that it is written in the method body. Usually, everything is connected in the upper part of the code, for example, these lines are the connection of the vert.x core and vert.x web classes. I have never encountered such a syntax, usually everything is connected at the top of the code, for example, so import io.vertx.rxjava.core.Vertx;). Please explain how to understand this syntax? and what happens in order in the newInstance() method