Package org.fulib.fx.controller.building
Class ControllerBuildFactory
java.lang.Object
org.fulib.fx.controller.building.ControllerBuildFactory
- All Implemented Interfaces:
javafx.util.BuilderFactory
A custom building-factory for instantiating controllers. If an element in an FXML file is of a class annotated with @Controller and a field providing an instance of the same class exists, the provided instance will be used as the controller for the element.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.util.Builder<?>getBuilder(Class<?> type) getProvidedInstance(Class<?> type) Searches the controller class for a field annotated with @SubController that provides an instance of the given type.
-
Constructor Details
-
ControllerBuildFactory
-
-
Method Details
-
getBuilder
- Specified by:
getBuilderin interfacejavafx.util.BuilderFactory
-
getProvidedInstance
Searches the controller class for a field annotated with @SubController that provides an instance of the given type. If no matching field is found, the framework will look for a provider field annotated with @SubController. If no matching provider is found, the framework will throw an exception.- Parameters:
type- The type of the subcontroller- Returns:
- The instance of the subcontroller
-