Skip to content

Commit

Permalink
Vert.x Configurators and build updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GedMarc committed Apr 14, 2024
1 parent 7380b2a commit 4b3d284
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 33 deletions.
26 changes: 11 additions & 15 deletions src/main/java/com/guicedee/guicedinjection/GuiceConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

import com.google.inject.Singleton;

import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;

/**
* The configuration class for Guice Context and the Classpath Scanner
*/
Expand Down Expand Up @@ -127,7 +123,7 @@ public boolean isFieldScanning()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setFieldScanning(boolean fieldScanning)
{
this.fieldScanning = fieldScanning;
Expand All @@ -142,7 +138,7 @@ public boolean isAnnotationScanning()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setAnnotationScanning(boolean annotationScanning)
{
this.annotationScanning = annotationScanning;
Expand All @@ -157,7 +153,7 @@ public boolean isMethodInfo()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setMethodInfo(boolean methodInfo)
{
this.methodInfo = methodInfo;
Expand All @@ -172,7 +168,7 @@ public boolean isIgnoreFieldVisibility()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setIgnoreFieldVisibility(boolean ignoreFieldVisibility)
{
this.ignoreFieldVisibility = ignoreFieldVisibility;
Expand All @@ -187,7 +183,7 @@ public boolean isIgnoreMethodVisibility()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setIgnoreMethodVisibility(boolean ignoreMethodVisibility)
{
this.ignoreMethodVisibility = ignoreMethodVisibility;
Expand All @@ -202,7 +198,7 @@ public boolean isIncludePackages()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setIncludePackages(boolean includePackages)
{
this.includePackages = includePackages;
Expand All @@ -217,7 +213,7 @@ public boolean isFieldInfo()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setFieldInfo(boolean fieldInfo)
{
this.fieldInfo = fieldInfo;
Expand All @@ -232,7 +228,7 @@ public boolean isVerbose()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setVerbose(boolean verbose)
{
this.verbose = verbose;
Expand All @@ -248,7 +244,7 @@ public boolean isClasspathScanning()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setClasspathScanning(boolean classpathScanning)
{
this.classpathScanning = classpathScanning;
Expand All @@ -263,7 +259,7 @@ public boolean isExcludeModulesAndJars()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setExcludeModulesAndJars(boolean excludeModulesAndJars)
{
this.excludeModulesAndJars = excludeModulesAndJars;
Expand All @@ -278,7 +274,7 @@ public boolean isExcludePaths()

@Override
@SuppressWarnings("unchecked")
@NotNull

public J setExcludePaths(boolean excludePaths)
{
this.excludePaths = excludePaths;
Expand Down
23 changes: 11 additions & 12 deletions src/main/java/com/guicedee/guicedinjection/GuiceContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.guicedee.client.*;
import com.guicedee.guicedinjection.interfaces.*;
import io.github.classgraph.*;
import jakarta.validation.constraints.*;
import lombok.extern.java.*;

import java.util.*;
Expand Down Expand Up @@ -96,7 +95,7 @@ private GuiceContext()
*
* @return The global Guice Injector Object, Never Null, Instantiates the Injector if not configured
*/
@NotNull

public synchronized Injector inject()
{
if (GuiceContext.buildingInjector)
Expand Down Expand Up @@ -240,7 +239,7 @@ private static int getJavaVersion()
*
* @return The physical Scan Result from the complete class scanner
*/
@NotNull

public ScanResult getScanResult()
{
if (scanResult == null)
Expand Down Expand Up @@ -722,7 +721,7 @@ private Map<Pattern, ResourceList.ByteArrayConsumer> quickScanFilesPattern()
* @return A set of them
*/
@SuppressWarnings("unchecked")
@NotNull

public <T> Set<T> getLoader(Class<T> loaderType, @SuppressWarnings("unused") boolean dontInject, ServiceLoader<T> serviceLoader)
{
if (!IGuiceContext
Expand Down Expand Up @@ -842,7 +841,7 @@ public GuiceConfig<?> getConfig()
*
* @return The list of guice post startups
*/
public @NotNull Set<IGuicePostStartup> loadPostStartupServices()
public Set<IGuicePostStartup> loadPostStartupServices()
{
return getLoader(IGuicePostStartup.class, ServiceLoader.load(IGuicePostStartup.class));
}
Expand All @@ -852,7 +851,7 @@ public GuiceConfig<?> getConfig()
*
* @return The list of guice post startups
*/
public @NotNull Set<IPathContentsRejectListScanner> loadPathRejectScanners()
public Set<IPathContentsRejectListScanner> loadPathRejectScanners()
{
return getLoader(IPathContentsRejectListScanner.class, true, ServiceLoader.load(IPathContentsRejectListScanner.class));
}
Expand All @@ -863,7 +862,7 @@ public GuiceConfig<?> getConfig()
*
* @return The list of guice post startups
*/
public @NotNull Set<IGuiceScanJarExclusions> loadJarRejectScanners()
public Set<IGuiceScanJarExclusions> loadJarRejectScanners()
{
return getLoader(IGuiceScanJarExclusions.class, true, ServiceLoader.load(IGuiceScanJarExclusions.class));
}
Expand All @@ -874,7 +873,7 @@ public GuiceConfig<?> getConfig()
*
* @return The list of guice post startups
*/
public @NotNull Set<IGuiceScanJarInclusions> loadJarInclusionScanners()
public Set<IGuiceScanJarInclusions> loadJarInclusionScanners()
{
return getLoader(IGuiceScanJarInclusions.class, true, ServiceLoader.load(IGuiceScanJarInclusions.class));
}
Expand All @@ -885,7 +884,7 @@ public GuiceConfig<?> getConfig()
*
* @return The list of guice post startups
*/
public @NotNull Set<IGuicePreStartup> loadPreStartupServices()
public Set<IGuicePreStartup> loadPreStartupServices()
{
return getLoader(IGuicePreStartup.class, true, ServiceLoader.load(IGuicePreStartup.class));
}
Expand All @@ -895,7 +894,7 @@ public GuiceConfig<?> getConfig()
*
* @return The list of guice post startups
*/
public @NotNull Set<IGuiceModule> loadIGuiceModules()
public Set<IGuiceModule> loadIGuiceModules()
{
return getLoader(IGuiceModule.class, true, ServiceLoader.load(IGuiceModule.class));
}
Expand All @@ -905,7 +904,7 @@ public GuiceConfig<?> getConfig()
*
* @return The list of guice configs
*/
public @NotNull Set<IGuiceConfigurator> loadIGuiceConfigs()
public Set<IGuiceConfigurator> loadIGuiceConfigs()
{
return getLoader(IGuiceConfigurator.class, true, ServiceLoader.load(IGuiceConfigurator.class));
}
Expand Down Expand Up @@ -936,7 +935,7 @@ private void loadPreStartups()
* @return A set of them
*/
@SuppressWarnings("unchecked")
@NotNull

public <T extends Comparable<T>> Set<T> getLoader(Class<T> loaderType, ServiceLoader<T> serviceLoader)
{
if (!IGuiceContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
import com.guicedee.guicedinjection.interfaces.IGuiceScanJarExclusions;
import com.guicedee.guicedinjection.interfaces.IGuiceScanModuleExclusions;

import jakarta.validation.constraints.NotNull;
import java.util.HashSet;
import java.util.Set;

public class GuiceDefaultModuleExclusions
implements IGuiceScanModuleExclusions<GuiceDefaultModuleExclusions>, IGuiceScanJarExclusions<GuiceDefaultModuleExclusions>
{
@Override
public @NotNull
public
Set<String> excludeModules()
{
Set<String> strings = new HashSet<>();
Expand Down Expand Up @@ -101,7 +100,7 @@ Set<String> excludeModules()
}

@Override
public @NotNull Set<String> excludeJars() {
public Set<String> excludeJars() {
Set<String> strings = new HashSet<>();
strings.add("activation-*");
strings.add("adal4j-*");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.guicedee.guicedinjection.implementations;

import com.guicedee.guicedinjection.interfaces.IGuiceScanModuleInclusions;
import jakarta.validation.constraints.NotNull;

import java.util.HashSet;
import java.util.Set;
Expand All @@ -10,8 +9,7 @@ public class GuiceDefaultModuleInclusions
implements IGuiceScanModuleInclusions<GuiceDefaultModuleInclusions>
{
@Override
public @NotNull
Set<String> includeModules()
public Set<String> includeModules()
{
Set<String> strings = new HashSet<>();
return strings;
Expand Down

0 comments on commit 4b3d284

Please sign in to comment.