While working on somebodys else code I found some weird construction, which for I couldnt find any explanation on the internet. Here is the whole method from JavaFXML Application:
private void logInUser(User selectedUser) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/movierecsys/gui/view/MovieRecView.fxml"));
Parent root1 = (Parent) fxmlLoader.load();
fxmlLoader.<MovieRecController>getController().setInfo(selectedUser);
Stage stage = (Stage) loginButton.getScene().getWindow();
stage.setScene(new Scene(root1));
stage.show();
}
And here is the line which is not really clear for me:
fxmlLoader.<MovieRecController>getController().setInfo(selectedUser);
What exactly means <MovieRecController>
? It looks like type casting, but i have never met before this construction for casting and I could find any explanation for this.