- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when initAndRender
is called on an element that is not a component.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework tries to render something that is not a component or controller. This error should never be thrown if the framework is used correctly.
1002: Method '*()' providing the view for class '*' must return a (subtype of) 'javafx.scene.Parent'.
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown when a method is used to create the view of a component, but the method doesn't return a Parent
object.
@Controller("#getView")
public class MyController {
public String getView() {
// Wrong, should return a Parent object (or a subclass of it)
return "This is not a Parent object";
}
}
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown when a method is used to create the view of a component, but the method does not exist.
@Controller("#getView")
public class MyController {
// Wrong, should be named getView (or change the name in the annotation)
public VBox myView() {
return new VBox();
}
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the method specified in the @Controller
annotation cannot be called successfully.
This can happen if the method throws an exception.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if a method annotated with an event annotation (@OnInit
, @OnRender
, @OnDestroy
, etc.) cannot be called
successfully.
This can happen if the method throws an exception.
- Runtime: ❌
- Annotation Processor: ✅
This error is thrown when the framework finds a class annotated with @Component
that is not a subclass of Parent
.
@Component
public class MyController { // Wrong, should extend Parent (or a subclass of it)
}
- Runtime: ❌
- Annotation Processor: ✅
This error is thrown when the framework finds a class annotated with both @Controller
and @Component
.
@Component
@Controller // Wrong, should be one or the other
public class MyComponent extends VBox {
}
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown when the method specified in the @Controller
annotation has arguments.
@Controller("#getView")
public class MyController {
// Wrong, must not have arguments
public VBox getView(String args) {
return new VBox();
}
}
- Runtime: ❌
- Annotation Processor: ✅
This error is thrown when a class annotated with @Title
is not a controller or component.
@Title("Example!")
public class NotAController { // Wrong, should be a controller or component
}
1010: Method '*' annotated with @OnKey in class '*' must either take no or exactly one parameter of type KeyEvent.
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown when a method annotated with @OnKey
has more than one parameter or a parameter that is not of type KeyEvent
.
@OnKey
public void onKey(String key) { // Wrong, should not have a parameter or have a parameter of type KeyEvent
// ...
}
@OnKey
public void onKey(KeyEvent event, String other) { // Wrong, should not have more than one parameter
// ...
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when a controller or component is shown as a root node of a scene, but does not provide a parent as
its view. This can happen when calling show
or opening a modal.
@Component
public class MyComponent extends ImageView { // Wrong, should extend Parent (or a subclass of it) to be displayed directly
// ...
}
show(new MyComponent()); // Wrong, should not be able to show a controller that does not provide a parent as its view
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown when the framework tries to access a private field or method.
public class MyController {
@Param("key") // Wrong, should not be private
private String string;
@OnInit() // Wrong, should not be private
private void init() {
// ...
}
// ...
}
1013: Method '*' annotated with an event annotation in class '*' overrides event method in class '*'.
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown if an event method overrides another event method as this would lead to the overriding method being called twice.
public class MyController extends BaseController {
@Override
@OnInit()
private void init() {
}
// ...
}
public class BaseController {
@OnInit() // Wrong, event methods shouldn't be overridden in sub classes
private void init() {
}
// ...
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when a component instance that is already included in a scene is used in a modal. A node can only be included in one scene, therefore using an already used component instance in a modal
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown when the framework tries to load a resource that does not exist. This can happen if the resource is not in the correct location or if the name is misspelled. If the source path isn't set in the build.gradle, the annotation processor will not be able to find the FXML files, see https://stackoverflow.com/a/74159042.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework tries to load a resource that exists, but cannot be linked back to its original file. The only situation where this error should be thrown is when the framework uses the file instead of the resource when in development mode.
- Runtime: ✅
- Annotation Processor: ❌
This error occurs when there is a problem in the FXML file for a component or controller. This can happen if the FXML file is not valid or if there is a problem with the file.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when there are multiple fields annotated with @Resource
in a single controller or component.
@Controller
public class MyController {
@Resource
ResourceBundle bundle1;
@Resource // Wrong, should not have multiple fields annotated with @Resource
ResourceBundle bundle2;
}
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown if there is a field annotated with @Resource
that is not a ResourceBundle
.
@Controller
public class MyController {
@Resource // Wrong, should be a ResourceBundle (or a subclass of it)
List<String> bundle;
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework fails to access a field as the resource bundle. This can happen if the field isn't initialized.
2006: Title '*' in class '*' specifies a language key, but no resource bundle was provided using @Resource.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when a title is specified using a language key, but no resource bundle is provided using @Resource
.
in the controller or component class.
- Runtime: ✅
- Annotation Processor: ❌
The error is thrown when a router class is used to register routes even though another class is already registered as the router.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework tries to register a field as a route provider even though it is not annotated
with @Route
.
This should never happen if the framework is used correctly.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when a route is registered with a path that is already in use.
public class Routes {
@Route("/path")
Provider<MyController> myController;
@Route("/path") // Wrong, should not have the same path as another route
Provider<OtherController> otherController;
}
3003: Field '*' in class '*' is annotated with @Route but is not a Provider<T> providing a controller/component.
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown when a field annotated with @Route
is not a Provider
of a Controller
or Component
.
public class Routes {
@Route("/path")
Provider<String> provider; // Wrong, should be a Provider of a Controller or Component
}
- Runtime: ❌
- Annotation Processor: ✅
This error is thrown when a field annotated with @Route
is not a Provider
.
public class Routes {
@Route("/path")
MyController controller; // Wrong, should be a Provider (e.g. Provider<MyController>)
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework tries to access a route that does not exist.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if one tries to go to the parent of a node without a parent in a tree structure.
This can happen if one uses show("../")
whilst already being at the empty route.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework fails to put a parameter value into a field.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework fails to call the set method of a property field with the parameter value. This can happen if the property is not initialized.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when a field is annotated with @ParamsMap
but is not a Map<String, Object>
or a subclass of it.
@Controller
public class MyController {
@ParamsMap // Wrong, should be a Map<String, Object> (or a subclass of it)
List<String> params;
}
4003: Method '*' annotated with @ParamsMap in class '*' must have exactly one parameter of type Map<String, Object>.
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown when a method annotated with @ParamsMap
has other arguments than a single Map<String, Object>
.
@Controller
public class MyController {
@ParamsMap
public void myMethod(Map<String, Object> params, String otherArg) { // Wrong, should not have other arguments
// ...
}
}
4004: Parameter '*' annotated with @ParamsMap in method '*' in class '*' is not of type Map<String, Object>.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework tries to call an event method with parameters, but the argument annotated
with @ParamsMap
is not a Map<String, Object>
or a subclass of it.
@Controller
public class MyController {
@OnInit
public void myMethod(@ParamsMap List<String> params) { // Wrong, should be a Map<String, Object> (or a subclass of it)
// ...
}
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework fails to call a method with a parameter (@Param
).
This can happen if the method throws an exception.
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown if a method is annotated with @Params
but the amount of arguments differs from the amount of
parameters in the annotation.
@Controller
public class MyController {
@Params({"param1", "param2", "param3"})
public void myMethod(String string, Integer number) { // Wrong, should have 3 arguments
// ...
}
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the type of the parameter value does not match the type of the field.
This error also occurs if the expected type is a primitive type and the provided value is null
.
4008: Parameter '*' in method '*' in class '*' is of type '*' but the provided value is of type '*'.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the type of the parameter value does not match the type of the method argument.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if a method argument is annotated with both @Param
and @ParamsMap
.
@Controller
public class MyController {
@OnInit
public void myMethod(@ParamsMap @Param("param1") Map<String, Object> params) { // Wrong, should not have both annotations for the same argument
// ...
}
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework fails to put the parameter map into a field.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework fails to call a method with parameters (@Params
).
This can happen if the method throws an exception.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if there is no previous element in the queue. This can happen if one tries to go back in the history, whilst already being at the first element.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if there is no next element in the queue. This can happen if one tries to go forward in the history, whilst already being at the last element.
6000: Multiple subcomponent providers annotated with @SubComponent with the same type '*' found in class '*'.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown when the framework finds multiple providers of the same type annotated with @SubComponent
in a
single controller or component.
This is forbidden as the framework cannot know which provider to use when creating subcomponent instances for the FXML
file.
@Controller(view = "myView.fxml")
public class MyController {
@SubComponent
Provider<MySubComponent> subComponent1;
@SubComponent // Wrong, should not have multiple providers of the same type
Provider<MySubComponent> subComponent2;
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework fails to access a provider to create a subcomponent instance for the FXML file. This can happen if the provider is not initialized.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework fails to access a field to use as a subcomponent instance for the FXML file. This can happen if the field is not initialized.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if an FXML file requests a subcomponent but there are no remaining available instances provided by the controller or component. If the FXML uses a subcomponent multiple times, the controller or component must provide multiple instances of the subcomponent or a provider thereof.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if an FXML file requests a subcomponent that is not provided by the controller or component.
6005: Field '*' in class '*' is annotated with @SubComponent but is not a subcomponent or provider thereof."
- Runtime: ✅
- Annotation Processor: ✅
This error is thrown if the @SubComponent
annotation is used on a field that is not a controller or component or a
provider thereof.
public class MyController {
@SubComponent
VBox box; // Wrong, should be a controller, component or a provider thereof
}
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework fails to determine the type a provider provides.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if a For
loop is initialized twice.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if an item is added to a For
loop twice.
The For
loop is meant to display nodes for a list of unique items.
Adding the same object twice causes an error to prevent linking issues.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework fails to run a method for a certain field. This error is internal and doesn't have a specific cause.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework fails to access a field.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework tries to get a value from an uninitialized field.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework fails to get the getChildren()
method of an object.
This can happen if the object is not a subclass of Parent
.
This should never happen if the framework is used correctly.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the file watcher fails to watch a directory.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if closing the file watcher fails.
- Runtime: ✅
- Annotation Processor: ❌
This error is thrown if the framework fails to create a copy of an object because no duplicator has been registered for the object's class.
- Runtime: ✅
- Annotation Processor: ❌
This error occurs when attempting to set up the AutoRefresher
with an invalid path, or forgetting to disable it outside development mode.
@Override
public void start(Stage primaryStage) {
// ...
// Bad: (in production, the src directory will not exist)
autoRefresher().setup(Path.of("src/main/resources/de/uniks/ludo"));
// Good: (guarded by an environment variable)
if (System.getenv("AUTO_REFRESH") != null) {
autoRefresher().setup(Path.of("src/main/resources/de/uniks/ludo"));
}
}