Adds gpg, sonatype, changes groupId

This commit is contained in:
Guillaume Tâche
2025-01-03 22:08:50 +01:00
parent c3d9e72e42
commit f59863c628
183 changed files with 860 additions and 779 deletions

View File

@@ -4,16 +4,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.gtache</groupId>
<groupId>ch.gtache.fxml-compiler</groupId>
<artifactId>fxml-compiler</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>fxml-compiler-core</artifactId>
<name>fxml-compiler-core</name>
<description>Core module for the fxml-compiler project</description>
<dependencies>
<dependency>
<groupId>com.github.gtache</groupId>
<groupId>ch.gtache.fxml-compiler</groupId>
<artifactId>fxml-compiler-api</artifactId>
</dependency>
<dependency>

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.compatibility.impl;
package ch.gtache.fxml.compiler.compatibility.impl;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
/**
* Implementation of {@link GenerationCompatibility}

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import java.io.IOException;
import java.net.URI;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerFieldInfo;
import com.github.gtache.fxml.compiler.GenericTypes;
import ch.gtache.fxml.compiler.ControllerFieldInfo;
import ch.gtache.fxml.compiler.GenericTypes;
import java.util.List;
import java.util.Objects;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerFieldInfo;
import com.github.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.ControllerFieldInfo;
import ch.gtache.fxml.compiler.ControllerInfo;
import java.util.Map;
import java.util.Objects;

View File

@@ -1,11 +1,11 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInjectionType;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInjectionType;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import java.util.Map;

View File

@@ -1,10 +1,10 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.SourceInfo;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.SourceInfo;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import java.util.Objects;

View File

@@ -1,10 +1,10 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.Generator;
import com.github.gtache.fxml.compiler.impl.internal.GenerationProgress;
import com.github.gtache.fxml.compiler.impl.internal.HelperProvider;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.Generator;
import ch.gtache.fxml.compiler.impl.internal.GenerationProgress;
import ch.gtache.fxml.compiler.impl.internal.HelperProvider;
import java.util.Objects;
import java.util.function.Function;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.GenericTypes;
import ch.gtache.fxml.compiler.GenericTypes;
import java.util.List;
import java.util.Objects;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.SourceInfo;
import ch.gtache.fxml.compiler.SourceInfo;
import java.nio.file.Path;
import java.util.List;

View File

@@ -1,22 +1,22 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import javafx.beans.property.Property;
import javafx.beans.property.ReadOnlyProperty;
import java.util.Arrays;
import java.util.SequencedCollection;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static java.util.Objects.requireNonNull;
/**
* Formatter for property bindings
*/
class BindingFormatter {
final class BindingFormatter {
private static final String PROPERTY = "Property";
@@ -72,10 +72,11 @@ class BindingFormatter {
if (bidirectional ? hasWriteProperty(className, methodName) : hasReadProperty(className, methodName)) {
final var returnType = ReflectionHelper.getReturnType(className, methodName);
final var expression = helperProvider.getExpressionFormatter().format(value, returnType);
final var binding = INDENT_8 + parentVariable + "." + methodName + "()." + bindMethod + "(" + expression + ");\n";
if (isControllerWithFactory(value)) {
controllerFactoryPostAction.add(INDENT_8 + parentVariable + "." + methodName + "()." + bindMethod + "(" + expression + ");\n");
controllerFactoryPostAction.add(binding);
} else {
sb.append(INDENT_8).append(parentVariable).append(".").append(methodName).append("().").append(bindMethod).append("(").append(expression).append(");\n");
sb.append(binding);
}
} else {
throw new GenerationException("Cannot bind " + name + " on " + className);

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import java.lang.reflect.Constructor;
import java.util.Collections;

View File

@@ -1,8 +1,8 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
@@ -40,6 +40,7 @@ final class ConstructorHelper {
final var type = parameter.type();
final var p = parsedObject.attributes().get(entry.getKey());
if (p == null) {
//Check if it is a complex property: If yes, throw an exception
final var c = parsedObject.properties().entrySet().stream().filter(e ->
e.getKey().name().equals(entry.getKey())).findFirst().orElse(null);
if (c == null) {

View File

@@ -1,14 +1,14 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import java.util.SequencedCollection;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.INDENT_8;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.INDENT_8;
import static java.util.Objects.requireNonNull;
/**
@@ -98,6 +98,7 @@ final class ControllerInjector {
final var controllerMethod = property.value().replace("#", "");
return switch (methodInjectionType) {
case REFERENCE -> {
// Checks if the method has the event as argument
final var hasArgument = controllerInfo.handlerHasArgument(controllerMethod);
if (hasArgument) {
yield INDENT_8 + parentVariable + "." + setMethod + "(controller::" + controllerMethod + ");\n";

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import javafx.beans.property.ReadOnlyProperty;
import java.util.Arrays;
@@ -42,8 +42,10 @@ class ExpressionFormatter {
String format(final String expression, final Class<?> returnType) throws GenerationException {
final var cleaned = expression.substring(2, expression.length() - 1).trim();
if (cleaned.contains(".")) {
//Reference to the property of an object
return getDotExpression(expression, returnType);
} else {
//Simple reference to an id
return getNonDotExpression(expression);
}
}
@@ -54,12 +56,14 @@ class ExpressionFormatter {
if (split.size() == 2) {
final var referenced = split.get(0);
final var value = split.get(1);
//Checks if it is a reference to the controller
if (referenced.equals("controller")) {
return getControllerExpression(value, returnType);
} else {
return getNonControllerExpression(referenced, value);
}
} else {
//Only supports one level
throw new GenerationException("Unsupported binding : " + expression);
}
}

View File

@@ -1,15 +1,15 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import java.util.Objects;
import java.util.SequencedCollection;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.EXPRESSION_PREFIX;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.INDENT_8;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.EXPRESSION_PREFIX;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.INDENT_8;
import static java.util.Objects.requireNonNull;
/**
@@ -81,6 +81,7 @@ final class FieldSetter {
}
private static String getSetString(final ParsedProperty property, final String parentVariable) throws GenerationException {
//If field injection is setter or factory, assume controller has getters
final var methodName = GenerationHelper.getSetMethod(property);
final var value = property.value().replace(EXPRESSION_PREFIX, "");
final var split = value.split("\\.");

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import javafx.scene.text.FontPosture;
import javafx.scene.text.FontWeight;
@@ -13,8 +13,8 @@ import java.net.URISyntaxException;
import java.net.URL;
import java.util.Objects;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.getSortedAttributes;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.getSortedAttributes;
/**
* Helper methods for {@link GeneratorImpl} to format fonts
@@ -89,7 +89,7 @@ final class FontFormatter {
for (final var property : sortedAttributes) {
switch (property.name()) {
case FX_ID -> {
//Do nothing
//Do nothing, handled in ObjectFormatter
}
case "name" -> {
try {

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import java.util.Objects;

View File

@@ -1,8 +1,8 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import java.util.List;
import java.util.Map;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import java.util.ArrayList;
import java.util.Objects;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import java.util.Objects;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import java.util.HashMap;
import java.util.Map;

View File

@@ -1,11 +1,11 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.getSortedAttributes;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.getSortedAttributes;
import static java.util.Objects.requireNonNull;
/**
@@ -42,7 +42,7 @@ final class ImageFormatter {
for (final var property : sortedAttributes) {
switch (property.name()) {
case FX_ID -> {
//Do nothing
//Do nothing, handled in ObjectFormatter
}
case "url" -> url = helperProvider.getURLFormatter().formatURL(property.value());
case "requestedWidth" -> requestedWidth = Double.parseDouble(property.value());

View File

@@ -1,12 +1,12 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.InjectionType;
import com.github.gtache.fxml.compiler.SourceInfo;
import com.github.gtache.fxml.compiler.parsing.ParsedInclude;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.InjectionType;
import ch.gtache.fxml.compiler.SourceInfo;
import ch.gtache.fxml.compiler.parsing.ParsedInclude;
import java.util.HashMap;
import java.util.HashSet;

View File

@@ -1,10 +1,10 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInjectionType;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInjectionType;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import static java.util.Objects.requireNonNull;

View File

@@ -1,18 +1,18 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedConstant;
import com.github.gtache.fxml.compiler.parsing.ParsedCopy;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedFactory;
import com.github.gtache.fxml.compiler.parsing.ParsedInclude;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedReference;
import com.github.gtache.fxml.compiler.parsing.ParsedText;
import com.github.gtache.fxml.compiler.parsing.ParsedValue;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedConstant;
import ch.gtache.fxml.compiler.parsing.ParsedCopy;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedFactory;
import ch.gtache.fxml.compiler.parsing.ParsedInclude;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedReference;
import ch.gtache.fxml.compiler.parsing.ParsedText;
import ch.gtache.fxml.compiler.parsing.ParsedValue;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import javafx.scene.Node;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -25,7 +25,7 @@ import java.util.List;
import java.util.SequencedCollection;
import java.util.Set;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static java.util.Objects.requireNonNull;
/**

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import static java.util.Objects.requireNonNull;

View File

@@ -1,14 +1,14 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.ParsedText;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedText;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import javafx.event.EventHandler;
import java.util.ArrayList;
@@ -16,7 +16,7 @@ import java.util.List;
import java.util.Objects;
import java.util.SequencedCollection;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static java.util.Objects.requireNonNull;
/**

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenericTypes;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenericTypes;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import javafx.beans.DefaultProperty;
import javafx.beans.NamedArg;
import org.apache.logging.log4j.LogManager;
@@ -21,7 +21,7 @@ import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
/**
* Helper methods for reflection

View File

@@ -1,11 +1,11 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import javafx.scene.paint.Color;
import java.util.ArrayList;
@@ -13,8 +13,8 @@ import java.util.Collection;
import java.util.List;
import java.util.stream.Stream;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.getSortedAttributes;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.getSortedAttributes;
import static java.util.Objects.requireNonNull;
/**
@@ -46,7 +46,7 @@ final class SceneFormatter {
for (final var property : sortedAttributes) {
switch (property.name()) {
case FX_ID -> {
//Do nothing
//Do nothing, handled in ObjectFormatter
}
case "width" -> width = Double.parseDouble(property.value());
case "height" -> height = Double.parseDouble(property.value());

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import javafx.scene.shape.VertexFormat;
import java.util.ArrayList;
@@ -14,7 +14,7 @@ import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static java.util.Objects.requireNonNull;
/**
@@ -42,7 +42,7 @@ final class TriangleMeshFormatter {
for (final var property : sortedAttributes) {
switch (property.name().toLowerCase()) {
case FX_ID -> {
//Do nothing
//Do nothing, handled in ObjectFormatter
}
case "points" -> {
points.clear();

View File

@@ -1,13 +1,13 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import java.util.ArrayList;
import java.util.List;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static java.util.Objects.requireNonNull;
@@ -54,7 +54,7 @@ final class URLFormatter {
for (final var property : sortedAttributes) {
switch (property.name()) {
case FX_ID -> {
//Do nothing
//Do nothing, handled in ObjectFormatter
}
case "value" -> value = property.value();
default -> throw new GenerationException("Unknown URL attribute : " + property.name());

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationException;
import java.math.BigDecimal;
import java.math.BigInteger;

View File

@@ -1,14 +1,14 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.regex.Pattern;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.*;
import static java.util.Objects.requireNonNull;
/**

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import java.util.Objects;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import java.util.HashMap;
import java.util.Map;

View File

@@ -1,12 +1,12 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GeneratorImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GeneratorImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static com.github.gtache.fxml.compiler.impl.internal.GenerationHelper.getSortedAttributes;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.FX_ID;
import static ch.gtache.fxml.compiler.impl.internal.GenerationHelper.getSortedAttributes;
import static java.util.Objects.requireNonNull;
/**
@@ -48,7 +48,7 @@ final class WebViewFormatter {
final String variableName, final String engineVariable) throws GenerationException {
switch (value.name()) {
case FX_ID -> {
//Do nothing
//Do nothing, handled in ObjectFormatter
}
case "confirmHandler" -> injectConfirmHandler(value, engineVariable);
case "createPopupHandler" -> injectCreatePopupHandler(value, engineVariable);

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedConstant;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedConstant;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import java.util.Map;
import java.util.Objects;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedCopy;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedCopy;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import java.util.Map;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import java.util.List;

View File

@@ -1,8 +1,8 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedFactory;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedFactory;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import java.util.List;
import java.util.Map;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedInclude;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedInclude;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import java.util.HashMap;
import java.util.Map;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import java.util.Collections;
import java.util.LinkedHashMap;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import static java.util.Objects.requireNonNull;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.ParsedReference;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedReference;
import java.util.Map;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedText;
import ch.gtache.fxml.compiler.parsing.ParsedText;
import java.util.Objects;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.ParsedValue;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedValue;
import java.util.Map;
import java.util.Objects;

View File

@@ -1,13 +1,13 @@
/**
* Core module for FXML compiler
*/
module com.github.gtache.fxml.compiler.core {
requires transitive com.github.gtache.fxml.compiler.api;
module ch.gtache.fxml.compiler.core {
requires transitive ch.gtache.fxml.compiler.api;
requires transitive javafx.graphics;
requires org.apache.logging.log4j;
requires java.sql;
exports com.github.gtache.fxml.compiler.impl;
exports com.github.gtache.fxml.compiler.parsing.impl;
exports com.github.gtache.fxml.compiler.compatibility.impl;
exports ch.gtache.fxml.compiler.impl;
exports ch.gtache.fxml.compiler.compatibility.impl;
exports ch.gtache.fxml.compiler.parsing.impl;
}

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.compatibility.impl;
package ch.gtache.fxml.compiler.compatibility.impl;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@@ -0,0 +1,40 @@
package ch.gtache.fxml.compiler.impl;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertEquals;
class TestClassesFinder {
@Test
void testGetClassesCurrent() throws IOException {
final var expected = Set.of(
"ch.gtache.fxml.compiler.parsing.impl.TestParsedConstantImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedCopyImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedDefineImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedFactoryImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedIncludeImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedObjectImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedPropertyImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedReferenceImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedTextImpl",
"ch.gtache.fxml.compiler.parsing.impl.TestParsedValueImpl");
final var actual = ClassesFinder.getClasses("ch.gtache.fxml.compiler.parsing.impl");
assertEquals(expected, actual);
}
@Test
void testGetClassesJar() throws IOException {
final var expected = Set.of("javafx.beans.DefaultProperty",
"javafx.beans.InvalidationListener",
"javafx.beans.NamedArg",
"javafx.beans.Observable",
"javafx.beans.WeakInvalidationListener",
"javafx.beans.WeakListener");
final var actual = ClassesFinder.getClasses("javafx.beans");
assertEquals(expected, actual);
}
}

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerFieldInfo;
import com.github.gtache.fxml.compiler.GenericTypes;
import ch.gtache.fxml.compiler.ControllerFieldInfo;
import ch.gtache.fxml.compiler.GenericTypes;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerFieldInfo;
import com.github.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.ControllerFieldInfo;
import ch.gtache.fxml.compiler.ControllerInfo;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,11 +1,11 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInjectionType;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInjectionType;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,10 +1,10 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.SourceInfo;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.SourceInfo;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,13 +1,13 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.Generator;
import com.github.gtache.fxml.compiler.impl.internal.HelperMethodsFormatter;
import com.github.gtache.fxml.compiler.impl.internal.HelperProvider;
import com.github.gtache.fxml.compiler.impl.internal.InitializationFormatter;
import com.github.gtache.fxml.compiler.impl.internal.LoadMethodFormatter;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.Generator;
import ch.gtache.fxml.compiler.impl.internal.HelperMethodsFormatter;
import ch.gtache.fxml.compiler.impl.internal.HelperProvider;
import ch.gtache.fxml.compiler.impl.internal.InitializationFormatter;
import ch.gtache.fxml.compiler.impl.internal.LoadMethodFormatter;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -41,8 +41,8 @@ class TestGeneratorImpl {
this.helperMethodsFormatter = requireNonNull(helperMethodsFormatter);
this.request = requireNonNull(request);
this.controllerInfo = requireNonNull(controllerInfo);
this.outputClassName = "com.github.gtache.fxml.compiler.OutputClass";
this.className = "com.github.gtache.fxml.compiler.ControllerClass";
this.outputClassName = "ch.gtache.fxml.compiler.OutputClass";
this.className = "ch.gtache.fxml.compiler.ControllerClass";
this.generator = new GeneratorImpl(p -> helperProvider);
}
@@ -59,7 +59,7 @@ class TestGeneratorImpl {
@Test
void testGenerate() throws GenerationException {
final var expected = """
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
/**
* Generated code
@@ -74,7 +74,7 @@ class TestGeneratorImpl {
* @return The controller
* @throws IllegalStateException If the view is not loaded
*/
public com.github.gtache.fxml.compiler.ControllerClass controller() {
public ch.gtache.fxml.compiler.ControllerClass controller() {
if (loaded) {
return controller;
} else {

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.GenericTypes;
import ch.gtache.fxml.compiler.GenericTypes;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.impl;
package ch.gtache.fxml.compiler.impl;
import com.github.gtache.fxml.compiler.SourceInfo;
import ch.gtache.fxml.compiler.SourceInfo;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import javafx.beans.NamedArg;
import javafx.scene.control.Spinner;
import org.junit.jupiter.api.Test;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -56,7 +56,7 @@ class TestControllerInjector {
@Test
void testInjectControllerFieldAssign() {
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.ASSIGN, com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.ASSIGN, ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
injector.injectControllerField(id, variable);
final var expected = " controller." + id + " = " + variable + ";\n";
assertEquals(expected, sb.toString());
@@ -65,7 +65,7 @@ class TestControllerInjector {
@Test
void testInjectControllerFieldSetters() {
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.SETTERS, com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.SETTERS, ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
injector.injectControllerField(id, variable);
final var expected = " controller." + GenerationHelper.getSetMethod(id) + "(" + variable + ");\n";
assertEquals(expected, sb.toString());
@@ -74,7 +74,7 @@ class TestControllerInjector {
@Test
void testInjectControllerFieldReflection() {
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.REFLECTION, com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.REFLECTION, ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
injector.injectControllerField(id, variable);
final var expected = " injectField(\"" + id + "\", " + variable + ");\n";
assertEquals(expected, sb.toString());
@@ -83,7 +83,7 @@ class TestControllerInjector {
@Test
void testInjectEventHandlerReferenceFactoryNoArgument() {
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.FACTORY, com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.FACTORY, ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
injector.injectEventHandlerControllerMethod(property, variable);
final var expected = " " + variable + "." + GenerationHelper.getSetMethod(property.name()) + "(e -> controller." + property.value().replace("#", "") + "());\n";
assertEquals(1, controllerFactoryPostAction.size());
@@ -93,7 +93,7 @@ class TestControllerInjector {
@Test
void testInjectEventHandlerReferenceFactoryWithArgument() {
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.FACTORY, com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.FACTORY, ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
when(controllerInfo.handlerHasArgument(propertyValue.replace("#", ""))).thenReturn(true);
injector.injectEventHandlerControllerMethod(property, variable);
final var expected = " " + variable + "." + GenerationHelper.getSetMethod(property.name()) + "(controller::" + propertyValue.replace("#", "") + ");\n";
@@ -104,7 +104,7 @@ class TestControllerInjector {
@Test
void testInjectEventHandlerReflectionAssign() {
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.ASSIGN, com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFLECTION, sb, controllerFactoryPostAction);
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.ASSIGN, ControllerMethodsInjectionType.REFLECTION, sb, controllerFactoryPostAction);
injector.injectEventHandlerControllerMethod(property, variable);
final var expected = " " + variable + "." + GenerationHelper.getSetMethod(property.name()) + "(e -> callEventHandlerMethod(\"" + propertyValue.replace("#", "") + "\", e));\n";
assertEquals(expected, sb.toString());
@@ -113,7 +113,7 @@ class TestControllerInjector {
@Test
void testInjectCallbackReflectionSetters() {
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.ASSIGN, com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFLECTION, sb, controllerFactoryPostAction);
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.ASSIGN, ControllerMethodsInjectionType.REFLECTION, sb, controllerFactoryPostAction);
injector.injectCallbackControllerMethod(property, variable, "clazz");
final var expected = " " + variable + "." + GenerationHelper.getSetMethod(property.name()) + "(e -> callCallbackMethod(\"" + propertyValue.replace("#", "") + "\", e, clazz));\n";
assertEquals(expected, sb.toString());
@@ -122,7 +122,7 @@ class TestControllerInjector {
@Test
void testInjectCallbackReferenceFactory() {
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.FACTORY, com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
final var injector = new ControllerInjector(controllerInfo, ControllerFieldInjectionType.FACTORY, ControllerMethodsInjectionType.REFERENCE, sb, controllerFactoryPostAction);
injector.injectCallbackControllerMethod(property, variable, "clazz");
final var expected = " " + variable + "." + GenerationHelper.getSetMethod(property.name()) + "(controller::" + propertyValue.replace("#", "") + ");\n";
assertEquals(1, controllerFactoryPostAction.size());

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import javafx.beans.property.StringProperty;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@@ -1,8 +1,8 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import com.github.gtache.fxml.compiler.compatibility.ListCollector;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.compatibility.ListCollector;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,8 +1,8 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.GenerationRequest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,13 +1,13 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.ControllerInjectionType;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.ControllerInjectionType;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -70,7 +70,7 @@ class TestHelperProvider {
final var bindingFormatter = helperProvider.getBindingFormatter();
assertSame(bindingFormatter, helperProvider.getBindingFormatter());
}
@Test
void testControllerInjector() {
final var injector = helperProvider.getControllerInjector();

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,14 +1,14 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.ControllerInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import com.github.gtache.fxml.compiler.SourceInfo;
import com.github.gtache.fxml.compiler.parsing.ParsedInclude;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.ControllerInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.SourceInfo;
import ch.gtache.fxml.compiler.parsing.ParsedInclude;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -68,10 +68,10 @@ class TestInitializationFormatter {
when(compatibilityHelper.getStartVar(anyString())).then(i -> i.getArgument(0));
when(variableProvider.getNextVariableName(anyString())).then(i -> i.getArgument(0));
when(request.parameters()).thenReturn(parameters);
when(request.outputClassName()).thenReturn("com.github.gtache.fxml.OutputClassName");
when(request.outputClassName()).thenReturn("ch.gtache.fxml.OutputClassName");
when(request.sourceInfo()).thenReturn(sourceInfo);
when(request.controllerInfo()).thenReturn(controllerInfo);
when(controllerInfo.className()).thenReturn("com.github.gtache.fxml.ControllerClassName");
when(controllerInfo.className()).thenReturn("ch.gtache.fxml.ControllerClassName");
when(sourceInfo.sourceToSourceInfo()).thenReturn(sourceToSourceInfo);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.GET_BUNDLE);
}
@@ -94,15 +94,15 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.FACTORY);
when(parameters.fieldInjectionType()).thenReturn(ControllerFieldInjectionType.FACTORY);
final var expected = """
private final java.util.function.Function<java.util.Map<String, Object>, com.github.gtache.fxml.ControllerClassName> controllerFactory;
private com.github.gtache.fxml.ControllerClassName controller;
private final java.util.function.Function<java.util.Map<String, Object>, ch.gtache.fxml.ControllerClassName> controllerFactory;
private ch.gtache.fxml.ControllerClassName controller;
private boolean loaded;
/**
* Instantiates a new OutputClassName
* @param controllerFactory The controller factory
*/
public OutputClassName(final java.util.function.Function<java.util.Map<String, Object>, com.github.gtache.fxml.ControllerClassName> controllerFactory) {
public OutputClassName(final java.util.function.Function<java.util.Map<String, Object>, ch.gtache.fxml.ControllerClassName> controllerFactory) {
this.controllerFactory = java.util.Objects.requireNonNull(controllerFactory);
}
""";
@@ -114,15 +114,15 @@ class TestInitializationFormatter {
void testFormatBaseFactory() throws GenerationException {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.FACTORY);
final var expected = """
private final java.util.function.Supplier<com.github.gtache.fxml.ControllerClassName> controllerFactory;
private com.github.gtache.fxml.ControllerClassName controller;
private final java.util.function.Supplier<ch.gtache.fxml.ControllerClassName> controllerFactory;
private ch.gtache.fxml.ControllerClassName controller;
private boolean loaded;
/**
* Instantiates a new OutputClassName
* @param controllerFactory The controller factory
*/
public OutputClassName(final java.util.function.Supplier<com.github.gtache.fxml.ControllerClassName> controllerFactory) {
public OutputClassName(final java.util.function.Supplier<ch.gtache.fxml.ControllerClassName> controllerFactory) {
this.controllerFactory = java.util.Objects.requireNonNull(controllerFactory);
}
""";
@@ -134,14 +134,14 @@ class TestInitializationFormatter {
void testFormatInstance() throws GenerationException {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
final var expected = """
private final com.github.gtache.fxml.ControllerClassName controller;
private final ch.gtache.fxml.ControllerClassName controller;
private boolean loaded;
/**
* Instantiates a new OutputClassName
* @param controller The controller instance
*/
public OutputClassName(final com.github.gtache.fxml.ControllerClassName controller) {
public OutputClassName(final ch.gtache.fxml.ControllerClassName controller) {
this.controller = java.util.Objects.requireNonNull(controller);
}
""";
@@ -154,7 +154,7 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR);
final var expected = """
private final com.github.gtache.fxml.ControllerClassName controller;
private final ch.gtache.fxml.ControllerClassName controller;
private final java.util.ResourceBundle resourceBundle;
private boolean loaded;
@@ -163,7 +163,7 @@ class TestInitializationFormatter {
* @param controller The controller instance
* @param resourceBundle The resource bundle
*/
public OutputClassName(final com.github.gtache.fxml.ControllerClassName controller, final java.util.ResourceBundle resourceBundle) {
public OutputClassName(final ch.gtache.fxml.ControllerClassName controller, final java.util.ResourceBundle resourceBundle) {
this.controller = java.util.Objects.requireNonNull(controller);
this.resourceBundle = java.util.Objects.requireNonNull(resourceBundle);
}
@@ -177,7 +177,7 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR_FUNCTION);
final var expected = """
private final com.github.gtache.fxml.ControllerClassName controller;
private final ch.gtache.fxml.ControllerClassName controller;
private final java.util.function.Function<String, String> resourceBundleFunction;
private boolean loaded;
@@ -186,7 +186,7 @@ class TestInitializationFormatter {
* @param controller The controller instance
* @param resourceBundleFunction The resource bundle
*/
public OutputClassName(final com.github.gtache.fxml.ControllerClassName controller, final java.util.function.Function<String, String> resourceBundleFunction) {
public OutputClassName(final ch.gtache.fxml.ControllerClassName controller, final java.util.function.Function<String, String> resourceBundleFunction) {
this.controller = java.util.Objects.requireNonNull(controller);
this.resourceBundleFunction = java.util.Objects.requireNonNull(resourceBundleFunction);
}
@@ -200,7 +200,7 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR_NAME);
final var expected = """
private final com.github.gtache.fxml.ControllerClassName controller;
private final ch.gtache.fxml.ControllerClassName controller;
private final String resourceBundleName;
private boolean loaded;
@@ -209,7 +209,7 @@ class TestInitializationFormatter {
* @param controller The controller instance
* @param resourceBundleName The resource bundle
*/
public OutputClassName(final com.github.gtache.fxml.ControllerClassName controller, final String resourceBundleName) {
public OutputClassName(final ch.gtache.fxml.ControllerClassName controller, final String resourceBundleName) {
this.controller = java.util.Objects.requireNonNull(controller);
this.resourceBundleName = java.util.Objects.requireNonNull(resourceBundleName);
}
@@ -223,28 +223,28 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.FACTORY);
when(parameters.fieldInjectionType()).thenReturn(ControllerFieldInjectionType.FACTORY);
final var expected = """
private final java.util.function.Function<java.util.Map<String, Object>, com.github.gtache.fxml.ControllerClassName> controllerFactory;
private final java.util.function.Function<java.util.Map<String, Object>, com.github.gtache.fxml.Controller2> controller2Factory;
private final java.util.function.Function<java.util.Map<String, Object>, com.github.gtache.fxml.Controller3> controller3Factory;
private com.github.gtache.fxml.ControllerClassName controller;
private final java.util.function.Function<java.util.Map<String, Object>, ch.gtache.fxml.ControllerClassName> controllerFactory;
private final java.util.function.Function<java.util.Map<String, Object>, ch.gtache.fxml.Controller2> controller2Factory;
private final java.util.function.Function<java.util.Map<String, Object>, ch.gtache.fxml.Controller3> controller3Factory;
private ch.gtache.fxml.ControllerClassName controller;
private boolean loaded;
/**
* Instantiates a new OutputClassName
* @param controllerFactory The controller factory
* @param controller2Factory The subcontroller factory for com.github.gtache.fxml.Controller2
* @param controller3Factory The subcontroller factory for com.github.gtache.fxml.Controller3
* @param controller2Factory The subcontroller factory for ch.gtache.fxml.Controller2
* @param controller3Factory The subcontroller factory for ch.gtache.fxml.Controller3
*/
public OutputClassName(final java.util.function.Function<java.util.Map<String, Object>, com.github.gtache.fxml.ControllerClassName> controllerFactory, final java.util.function.Function<java.util.Map<String, Object>, com.github.gtache.fxml.Controller2> controller2Factory, final java.util.function.Function<java.util.Map<String, Object>, com.github.gtache.fxml.Controller3> controller3Factory) {
public OutputClassName(final java.util.function.Function<java.util.Map<String, Object>, ch.gtache.fxml.ControllerClassName> controllerFactory, final java.util.function.Function<java.util.Map<String, Object>, ch.gtache.fxml.Controller2> controller2Factory, final java.util.function.Function<java.util.Map<String, Object>, ch.gtache.fxml.Controller3> controller3Factory) {
this.controllerFactory = java.util.Objects.requireNonNull(controllerFactory);
this.controller2Factory = java.util.Objects.requireNonNull(controller2Factory);
this.controller3Factory = java.util.Objects.requireNonNull(controller3Factory);
}
""";
final var source2 = mock(SourceInfo.class);
when(source2.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(source2.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
final var source3 = mock(SourceInfo.class);
when(source3.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller3");
when(source3.controllerClassName()).thenReturn("ch.gtache.fxml.Controller3");
when(sourceInfo.includedSources()).thenReturn(List.of(source2));
when(source2.includedSources()).thenReturn(List.of(source3));
initializationFormatter.formatFieldsAndConstructor();
@@ -255,28 +255,28 @@ class TestInitializationFormatter {
void testHasControllersBaseFactory() throws GenerationException {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.FACTORY);
final var expected = """
private final java.util.function.Supplier<com.github.gtache.fxml.ControllerClassName> controllerFactory;
private final java.util.function.Supplier<com.github.gtache.fxml.Controller2> controller2Factory;
private final java.util.function.Supplier<com.github.gtache.fxml.Controller3> controller3Factory;
private com.github.gtache.fxml.ControllerClassName controller;
private final java.util.function.Supplier<ch.gtache.fxml.ControllerClassName> controllerFactory;
private final java.util.function.Supplier<ch.gtache.fxml.Controller2> controller2Factory;
private final java.util.function.Supplier<ch.gtache.fxml.Controller3> controller3Factory;
private ch.gtache.fxml.ControllerClassName controller;
private boolean loaded;
/**
* Instantiates a new OutputClassName
* @param controllerFactory The controller factory
* @param controller2Factory The subcontroller factory for com.github.gtache.fxml.Controller2
* @param controller3Factory The subcontroller factory for com.github.gtache.fxml.Controller3
* @param controller2Factory The subcontroller factory for ch.gtache.fxml.Controller2
* @param controller3Factory The subcontroller factory for ch.gtache.fxml.Controller3
*/
public OutputClassName(final java.util.function.Supplier<com.github.gtache.fxml.ControllerClassName> controllerFactory, final java.util.function.Supplier<com.github.gtache.fxml.Controller2> controller2Factory, final java.util.function.Supplier<com.github.gtache.fxml.Controller3> controller3Factory) {
public OutputClassName(final java.util.function.Supplier<ch.gtache.fxml.ControllerClassName> controllerFactory, final java.util.function.Supplier<ch.gtache.fxml.Controller2> controller2Factory, final java.util.function.Supplier<ch.gtache.fxml.Controller3> controller3Factory) {
this.controllerFactory = java.util.Objects.requireNonNull(controllerFactory);
this.controller2Factory = java.util.Objects.requireNonNull(controller2Factory);
this.controller3Factory = java.util.Objects.requireNonNull(controller3Factory);
}
""";
final var source2 = mock(SourceInfo.class);
when(source2.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(source2.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
final var source3 = mock(SourceInfo.class);
when(source3.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller3");
when(source3.controllerClassName()).thenReturn("ch.gtache.fxml.Controller3");
when(sourceInfo.includedSources()).thenReturn(List.of(source2));
when(source2.includedSources()).thenReturn(List.of(source3));
initializationFormatter.formatFieldsAndConstructor();
@@ -287,27 +287,27 @@ class TestInitializationFormatter {
void testHasControllersInstance() throws GenerationException {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
final var expected = """
private final com.github.gtache.fxml.ControllerClassName controller;
private final com.github.gtache.fxml.Controller2 controller2;
private final com.github.gtache.fxml.Controller3 controller3;
private final ch.gtache.fxml.ControllerClassName controller;
private final ch.gtache.fxml.Controller2 controller2;
private final ch.gtache.fxml.Controller3 controller3;
private boolean loaded;
/**
* Instantiates a new OutputClassName
* @param controller The controller instance
* @param controller2 The subcontroller instance for com.github.gtache.fxml.Controller2
* @param controller3 The subcontroller instance for com.github.gtache.fxml.Controller3
* @param controller2 The subcontroller instance for ch.gtache.fxml.Controller2
* @param controller3 The subcontroller instance for ch.gtache.fxml.Controller3
*/
public OutputClassName(final com.github.gtache.fxml.ControllerClassName controller, final com.github.gtache.fxml.Controller2 controller2, final com.github.gtache.fxml.Controller3 controller3) {
public OutputClassName(final ch.gtache.fxml.ControllerClassName controller, final ch.gtache.fxml.Controller2 controller2, final ch.gtache.fxml.Controller3 controller3) {
this.controller = java.util.Objects.requireNonNull(controller);
this.controller2 = java.util.Objects.requireNonNull(controller2);
this.controller3 = java.util.Objects.requireNonNull(controller3);
}
""";
final var source2 = mock(SourceInfo.class);
when(source2.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(source2.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
final var source3 = mock(SourceInfo.class);
when(source3.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller3");
when(source3.controllerClassName()).thenReturn("ch.gtache.fxml.Controller3");
when(sourceInfo.includedSources()).thenReturn(List.of(source2));
when(source2.includedSources()).thenReturn(List.of(source3));
initializationFormatter.formatFieldsAndConstructor();
@@ -319,21 +319,21 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.FACTORY);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR);
final var expected = """
private final java.util.function.Supplier<com.github.gtache.fxml.ControllerClassName> controllerFactory;
private final java.util.function.Supplier<com.github.gtache.fxml.Controller2> controller2Factory;
private final java.util.function.Supplier<com.github.gtache.fxml.Controller3> controller3Factory;
private com.github.gtache.fxml.ControllerClassName controller;
private final java.util.function.Supplier<ch.gtache.fxml.ControllerClassName> controllerFactory;
private final java.util.function.Supplier<ch.gtache.fxml.Controller2> controller2Factory;
private final java.util.function.Supplier<ch.gtache.fxml.Controller3> controller3Factory;
private ch.gtache.fxml.ControllerClassName controller;
private final java.util.ResourceBundle resourceBundle;
private boolean loaded;
/**
* Instantiates a new OutputClassName
* @param controllerFactory The controller factory
* @param controller2Factory The subcontroller factory for com.github.gtache.fxml.Controller2
* @param controller3Factory The subcontroller factory for com.github.gtache.fxml.Controller3
* @param controller2Factory The subcontroller factory for ch.gtache.fxml.Controller2
* @param controller3Factory The subcontroller factory for ch.gtache.fxml.Controller3
* @param resourceBundle The resource bundle
*/
public OutputClassName(final java.util.function.Supplier<com.github.gtache.fxml.ControllerClassName> controllerFactory, final java.util.function.Supplier<com.github.gtache.fxml.Controller2> controller2Factory, final java.util.function.Supplier<com.github.gtache.fxml.Controller3> controller3Factory, final java.util.ResourceBundle resourceBundle) {
public OutputClassName(final java.util.function.Supplier<ch.gtache.fxml.ControllerClassName> controllerFactory, final java.util.function.Supplier<ch.gtache.fxml.Controller2> controller2Factory, final java.util.function.Supplier<ch.gtache.fxml.Controller3> controller3Factory, final java.util.ResourceBundle resourceBundle) {
this.controllerFactory = java.util.Objects.requireNonNull(controllerFactory);
this.controller2Factory = java.util.Objects.requireNonNull(controller2Factory);
this.controller3Factory = java.util.Objects.requireNonNull(controller3Factory);
@@ -341,9 +341,9 @@ class TestInitializationFormatter {
}
""";
final var source2 = mock(SourceInfo.class);
when(source2.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(source2.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
final var source3 = mock(SourceInfo.class);
when(source3.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller3");
when(source3.controllerClassName()).thenReturn("ch.gtache.fxml.Controller3");
when(sourceInfo.includedSources()).thenReturn(List.of(source2, source3));
when(source2.includedSources()).thenReturn(List.of(source3));
initializationFormatter.formatFieldsAndConstructor();
@@ -360,11 +360,11 @@ class TestInitializationFormatter {
when(include.source()).thenReturn("source");
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
when(subInfo.includedSources()).thenReturn(List.of());
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2);\n";
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -374,11 +374,11 @@ class TestInitializationFormatter {
when(include.source()).thenReturn("source");
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.FACTORY);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
when(subInfo.includedSources()).thenReturn(List.of());
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2Factory);\n";
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2Factory);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -386,21 +386,21 @@ class TestInitializationFormatter {
@Test
void testFormatSubViewMultipleInstanceFactory(@Mock final SourceInfo subInfo) throws GenerationException {
final var source3 = mock(SourceInfo.class);
when(source3.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller3");
when(source3.controllerClassName()).thenReturn("ch.gtache.fxml.Controller3");
when(source3.includedSources()).thenReturn(List.of());
final var source4 = mock(SourceInfo.class);
when(source4.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller4");
when(source4.controllerClassName()).thenReturn("ch.gtache.fxml.Controller4");
when(source4.includedSources()).thenReturn(List.of());
when(subInfo.includedSources()).thenReturn(List.of(source3, source4));
when(include.source()).thenReturn("source");
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.FACTORY);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller3", "controller3");
controllerClassToVariable.put("com.github.gtache.fxml.Controller4", "controller4");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2Factory, controller3Factory, controller4Factory);\n";
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
controllerClassToVariable.put("ch.gtache.fxml.Controller3", "controller3");
controllerClassToVariable.put("ch.gtache.fxml.Controller4", "controller4");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2Factory, controller3Factory, controller4Factory);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -408,21 +408,21 @@ class TestInitializationFormatter {
@Test
void testFormatSubViewMultipleInstance(@Mock final SourceInfo subInfo) throws GenerationException {
final var source3 = mock(SourceInfo.class);
when(source3.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller3");
when(source3.controllerClassName()).thenReturn("ch.gtache.fxml.Controller3");
when(source3.includedSources()).thenReturn(List.of());
final var source4 = mock(SourceInfo.class);
when(source4.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller4");
when(source4.controllerClassName()).thenReturn("ch.gtache.fxml.Controller4");
when(source4.includedSources()).thenReturn(List.of());
when(subInfo.includedSources()).thenReturn(List.of(source3, source4));
when(include.source()).thenReturn("source");
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller3", "controller3");
controllerClassToVariable.put("com.github.gtache.fxml.Controller4", "controller4");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2, controller3, controller4);\n";
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
controllerClassToVariable.put("ch.gtache.fxml.Controller3", "controller3");
controllerClassToVariable.put("ch.gtache.fxml.Controller4", "controller4");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2, controller3, controller4);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -435,10 +435,10 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.GETTER);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2);\n";
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -451,10 +451,10 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.GET_BUNDLE);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2);\n";
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -467,10 +467,10 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2, resourceBundle);\n";
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2, resourceBundle);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -483,10 +483,10 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR_FUNCTION);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2, resourceBundleFunction);\n";
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2, resourceBundleFunction);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -499,10 +499,10 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR_NAME);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
final var expected = "com.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2, resourceBundleName);\n";
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
final var expected = "ch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2, resourceBundleName);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -515,11 +515,11 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
when(include.resources()).thenReturn("resources");
final var expected = "java.util.ResourceBundleresourceBundle = java.util.ResourceBundle.getBundle(\"resources\");\ncom.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2, resourceBundle);\n";
final var expected = "java.util.ResourceBundleresourceBundle = java.util.ResourceBundle.getBundle(\"resources\");\nch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2, resourceBundle);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -532,11 +532,11 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR_FUNCTION);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
when(include.resources()).thenReturn("resources");
final var expected = "java.util.ResourceBundleresourceBundle = java.util.ResourceBundle.getBundle(\"resources\");\njava.util.function.Function<String, String>resourceBundleFunction = (java.util.function.Function<String, String>) s -> resourceBundle.getString(s);\ncom.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2, resourceBundleFunction);\n";
final var expected = "java.util.ResourceBundleresourceBundle = java.util.ResourceBundle.getBundle(\"resources\");\njava.util.function.Function<String, String>resourceBundleFunction = (java.util.function.Function<String, String>) s -> resourceBundle.getString(s);\nch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2, resourceBundleFunction);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -549,11 +549,11 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR_NAME);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
when(include.resources()).thenReturn("resources");
final var expected = "StringresourceBundleName = \"resources\";\ncom.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2, resourceBundleName);\n";
final var expected = "StringresourceBundleName = \"resources\";\nch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2, resourceBundleName);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}
@@ -561,10 +561,10 @@ class TestInitializationFormatter {
@Test
void testFormatSubViewComplete(@Mock final SourceInfo subInfo) throws GenerationException {
final var source3 = mock(SourceInfo.class);
when(source3.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller3");
when(source3.controllerClassName()).thenReturn("ch.gtache.fxml.Controller3");
when(source3.includedSources()).thenReturn(List.of());
final var source4 = mock(SourceInfo.class);
when(source4.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller4");
when(source4.controllerClassName()).thenReturn("ch.gtache.fxml.Controller4");
when(source4.includedSources()).thenReturn(List.of(source3));
when(subInfo.includedSources()).thenReturn(List.of(source4));
when(subInfo.requiresResourceBundle()).thenReturn(true);
@@ -572,13 +572,13 @@ class TestInitializationFormatter {
when(parameters.controllerInjectionType()).thenReturn(ControllerInjectionType.INSTANCE);
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.CONSTRUCTOR_NAME);
sourceToSourceInfo.put("source", subInfo);
when(subInfo.controllerClassName()).thenReturn("com.github.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("com.github.gtache.fxml.View2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller2", "controller2");
controllerClassToVariable.put("com.github.gtache.fxml.Controller3", "controller3");
controllerClassToVariable.put("com.github.gtache.fxml.Controller4", "controller4");
when(subInfo.controllerClassName()).thenReturn("ch.gtache.fxml.Controller2");
when(subInfo.generatedClassName()).thenReturn("ch.gtache.fxml.View2");
controllerClassToVariable.put("ch.gtache.fxml.Controller2", "controller2");
controllerClassToVariable.put("ch.gtache.fxml.Controller3", "controller3");
controllerClassToVariable.put("ch.gtache.fxml.Controller4", "controller4");
when(include.resources()).thenReturn("resources");
final var expected = "StringresourceBundleName = \"resources\";\ncom.github.gtache.fxml.View2view2 = new com.github.gtache.fxml.View2(controller2, controller3, controller4, resourceBundleName);\n";
final var expected = "StringresourceBundleName = \"resources\";\nch.gtache.fxml.View2view2 = new ch.gtache.fxml.View2(controller2, controller3, controller4, resourceBundleName);\n";
assertEquals("view2", initializationFormatter.formatSubViewConstructorCall(include));
assertEquals(expected, sb.toString());
}

View File

@@ -1,14 +1,14 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.ControllerInjectionType;
import com.github.gtache.fxml.compiler.ControllerMethodsInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.ControllerInjectionType;
import ch.gtache.fxml.compiler.ControllerMethodsInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -170,7 +170,7 @@ class TestLoadMethodFormatter {
void testGetBundleFieldFactoryReflectionNoBundle() throws GenerationException {
when(parameters.resourceInjectionType()).thenReturn(ResourceBundleInjectionType.GET_BUNDLE);
when(parameters.fieldInjectionType()).thenReturn(ControllerFieldInjectionType.FACTORY);
when(parameters.methodInjectionType()).thenReturn(com.github.gtache.fxml.compiler.ControllerMethodsInjectionType.REFLECTION);
when(parameters.methodInjectionType()).thenReturn(ControllerMethodsInjectionType.REFLECTION);
when(parameters.bundleMap()).thenReturn(Map.of());
when(object.toString()).thenReturn("object");
loadMethodFormatter.formatLoadMethod();

View File

@@ -1,18 +1,18 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInfo;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.SourceInfo;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedInclude;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.ParsedReference;
import com.github.gtache.fxml.compiler.parsing.impl.*;
import ch.gtache.fxml.compiler.ControllerFieldInfo;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.SourceInfo;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedInclude;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedReference;
import ch.gtache.fxml.compiler.parsing.impl.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import org.junit.jupiter.api.Test;

View File

@@ -1,16 +1,16 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInjectionType;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.GenerationParameters;
import com.github.gtache.fxml.compiler.GenerationRequest;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedObjectImpl;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedTextImpl;
import ch.gtache.fxml.compiler.ControllerFieldInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.GenerationParameters;
import ch.gtache.fxml.compiler.GenerationRequest;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedObjectImpl;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.parsing.impl.ParsedTextImpl;
import javafx.event.EventHandler;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;

View File

@@ -1,12 +1,12 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.ControllerFieldInfo;
import com.github.gtache.fxml.compiler.ControllerInfo;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.impl.GenericTypesImpl;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.ControllerFieldInfo;
import ch.gtache.fxml.compiler.ControllerInfo;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.impl.GenericTypesImpl;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Node;

View File

@@ -1,10 +1,10 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import javafx.scene.Node;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.ResourceBundleInjectionType;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.ResourceBundleInjectionType;
import javafx.geometry.Pos;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import com.github.gtache.fxml.compiler.GenerationException;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import ch.gtache.fxml.compiler.GenerationException;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.impl.ParsedPropertyImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.impl.internal;
package ch.gtache.fxml.compiler.impl.internal;
import javafx.beans.NamedArg;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedConstant;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedConstant;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.Test;
import java.util.HashMap;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedCopy;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedCopy;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedFactory;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedFactory;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedInclude;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedInclude;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,8 +1,8 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedDefine;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedDefine;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.ParsedReference;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedReference;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedText;
import ch.gtache.fxml.compiler.parsing.ParsedText;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.fxml.compiler.parsing.impl;
package ch.gtache.fxml.compiler.parsing.impl;
import com.github.gtache.fxml.compiler.parsing.ParsedProperty;
import com.github.gtache.fxml.compiler.parsing.ParsedValue;
import ch.gtache.fxml.compiler.parsing.ParsedProperty;
import ch.gtache.fxml.compiler.parsing.ParsedValue;
import org.junit.jupiter.api.Test;
import java.util.HashMap;

View File

@@ -1,40 +0,0 @@
package com.github.gtache.fxml.compiler.impl;
import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.Set;
import static org.junit.jupiter.api.Assertions.assertEquals;
class TestClassesFinder {
@Test
void testGetClassesCurrent() throws IOException {
final var expected = Set.of(
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedConstantImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedCopyImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedDefineImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedFactoryImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedIncludeImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedObjectImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedPropertyImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedReferenceImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedTextImpl",
"com.github.gtache.fxml.compiler.parsing.impl.TestParsedValueImpl");
final var actual = ClassesFinder.getClasses("com.github.gtache.fxml.compiler.parsing.impl");
assertEquals(expected, actual);
}
@Test
void testGetClassesJar() throws IOException {
final var expected = Set.of("javafx.beans.DefaultProperty",
"javafx.beans.InvalidationListener",
"javafx.beans.NamedArg",
"javafx.beans.Observable",
"javafx.beans.WeakInvalidationListener",
"javafx.beans.WeakListener");
final var actual = ClassesFinder.getClasses("javafx.beans");
assertEquals(expected, actual);
}
}