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

@@ -19,7 +19,7 @@ Add the plugin to your project:
<build>
<plugins>
<plugin>
<groupId>com.github.gtache</groupId>
<groupId>ch.gtache.fxml-compiler</groupId>
<artifactId>fxml-compiler-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
@@ -41,7 +41,7 @@ Optionally add dependencies to the plugin (e.g. when using MediaView and control
<build>
<plugins>
<plugin>
<groupId>com.github.gtache</groupId>
<groupId>ch.gtache.fxml-compiler</groupId>
<artifactId>fxml-compiler-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
@@ -114,7 +114,7 @@ There are four ways to inject fields into a controller:
- `SETTERS`: controller setters methods
- `controller.setField(value)`
- `FACTORY`: controller factory
- `controller = factory.create(fieldMap)`
- `controller = factory.apply(fieldMap)`
- `factory` is a `Function<Map<String, Object>, Controller>` instance that is created at runtime and passed to the
view.
- `fieldMap` is a map of field name (String) to value (Object) that is computed during the view `load` method.

View File

@@ -4,11 +4,13 @@
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-api</artifactId>
<name>fxml-compiler-api</name>
<description>API module for the fxml-compiler project</description>
</project>

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
/**
* Base field {@link InjectionType}s

View File

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

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
/**
* Base controller {@link InjectionType}s

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
/**
* Base methods {@link InjectionType}s

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
/**
* Exception thrown when a generation error occurs

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
import com.github.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import ch.gtache.fxml.compiler.compatibility.GenerationCompatibility;
import java.util.Map;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
import com.github.gtache.fxml.compiler.parsing.ParsedObject;
import ch.gtache.fxml.compiler.parsing.ParsedObject;
/**
* Represents a request for a code generation

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
/**
* Generates compiled FXML code

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
/**
* A type of injection for controllers

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler;
package ch.gtache.fxml.compiler;
/**
* Base {@link InjectionType}s for resource bundles

View File

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

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.compatibility;
package ch.gtache.fxml.compiler.compatibility;
/**
* Compatibility information for generated code

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.compatibility;
package ch.gtache.fxml.compiler.compatibility;
/**
* Type of list collector to use for generated code

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.io.IOException;
import java.nio.file.Files;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
/**
* Exception thrown when a parsing error occurs

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.LinkedHashMap;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.LinkedHashMap;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.LinkedHashMap;
import java.util.Map;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.LinkedHashMap;
import java.util.SequencedCollection;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.LinkedHashMap;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.Map;
import java.util.SequencedCollection;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
/**
* Parsed property/attribute from FXML

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.LinkedHashMap;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.LinkedHashMap;
import java.util.List;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.fxml.compiler.parsing;
package ch.gtache.fxml.compiler.parsing;
import java.util.LinkedHashMap;
import java.util.List;

View File

@@ -1,8 +1,8 @@
/**
* API module for FXML compiler
*/
module com.github.gtache.fxml.compiler.api {
exports com.github.gtache.fxml.compiler;
exports com.github.gtache.fxml.compiler.compatibility;
exports com.github.gtache.fxml.compiler.parsing;
module ch.gtache.fxml.compiler.api {
exports ch.gtache.fxml.compiler;
exports ch.gtache.fxml.compiler.compatibility;
exports ch.gtache.fxml.compiler.parsing;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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;

Some files were not shown because too many files have changed in this diff Show More