Separate JavaFX loading from the Neitzel injection container
This commit is contained in:
@@ -125,7 +125,7 @@ public class ApplicationContext {
|
||||
private ComponentData componentData(Class<?> type) {
|
||||
ComponentData data = components.get(type);
|
||||
if (data == null) {
|
||||
throw new IllegalArgumentException("No component found for type: " + type.getName());
|
||||
throw new MissingComponentException(type);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package de.neitzel.injection;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/** A lookup requested a type with no registration in the ApplicationContext. */
|
||||
@Getter
|
||||
public final class MissingComponentException extends IllegalArgumentException {
|
||||
|
||||
private final Class<?> componentType;
|
||||
|
||||
public MissingComponentException(Class<?> componentType) {
|
||||
super("No component found for type: " + componentType.getName());
|
||||
this.componentType = componentType;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user