Class ConfigResolver


  • public class ConfigResolver
    extends java.lang.Object
    Helper class that helps scanning jars in the classpath looking for files in META-INF/substrate/config that contain information that has to be added to the config files and native image command line flags
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigResolver​(java.lang.String classpath)
      ConfigResolver constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> getResourceBundlesList​(java.lang.String archOs)
      Walks through the jars in the classpath, and looks for META-INF/substrate/config/resourcebundles or META-INF/substrate/config/resourcebundles-${archos} files.
      java.util.List<java.lang.String> getUserInitBuildTimeList​(java.lang.String archOs)
      Walks through the jars in the classpath, and looks for META-INF/substrate/config/initbuildtime or META-INF/substrate/config/initbuildtime-${archos} files.
      java.util.List<java.lang.String> getUserJNIList​(java.lang.String archOs)
      Walks through the jars in the classpath, and looks for META-INF/substrate/config/jniconfig or META-INF/substrate/config/jniconfig-${archos} files.
      java.util.List<java.lang.String> getUserReflectionList​(java.lang.String archOs)
      Walks through the jars in the classpath, and looks for META-INF/substrate/config/reflectionconfig or META-INF/substrate/config/reflectionconfig-${archos} files.
      java.util.List<java.lang.String> getUserResourcesList​(java.lang.String archOs)
      Walks through the jars in the classpath, and looks for META-INF/substrate/config/resourceconfig or META-INF/substrate/config/resourceconfig-${archos} files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConfigResolver

        public ConfigResolver​(java.lang.String classpath)
                       throws java.io.IOException,
                              java.lang.InterruptedException
        ConfigResolver constructor
        Parameters:
        classpath - a string with the full classpath of the user's project
        Throws:
        java.io.IOException
        java.lang.InterruptedException
    • Method Detail

      • getUserInitBuildTimeList

        public java.util.List<java.lang.String> getUserInitBuildTimeList​(java.lang.String archOs)
                                                                  throws java.io.IOException
        Walks through the jars in the classpath, and looks for META-INF/substrate/config/initbuildtime or META-INF/substrate/config/initbuildtime-${archos} files. The method will return a list of class names from all the files found
        Parameters:
        archOs - a string with the arch and os, it can be null
        Returns:
        a list of classes that should be initialized at build time
        Throws:
        java.io.IOException
      • getResourceBundlesList

        public java.util.List<java.lang.String> getResourceBundlesList​(java.lang.String archOs)
                                                                throws java.io.IOException
        Walks through the jars in the classpath, and looks for META-INF/substrate/config/resourcebundles or META-INF/substrate/config/resourcebundles-${archos} files. The method will return a list of resource bundles names from all the files found
        Parameters:
        archOs - a string with the arch and os, it can be null
        Returns:
        a list of resource bundles
        Throws:
        java.io.IOException
      • getUserReflectionList

        public java.util.List<java.lang.String> getUserReflectionList​(java.lang.String archOs)
                                                               throws java.io.IOException
        Walks through the jars in the classpath, and looks for META-INF/substrate/config/reflectionconfig or META-INF/substrate/config/reflectionconfig-${archos} files. The method will return a list of lines from all the files found
        Parameters:
        archOs - a string with the arch and os, it can be null
        Returns:
        a list of lines that should be added to the reflectionconfig.json file
        Throws:
        java.io.IOException
      • getUserJNIList

        public java.util.List<java.lang.String> getUserJNIList​(java.lang.String archOs)
                                                        throws java.io.IOException
        Walks through the jars in the classpath, and looks for META-INF/substrate/config/jniconfig or META-INF/substrate/config/jniconfig-${archos} files. The method will return a list of lines from all the files found
        Parameters:
        archOs - a string with the arch and os, it can be null
        Returns:
        a list of lines that should be added to the jniconfig.json file
        Throws:
        java.io.IOException
      • getUserResourcesList

        public java.util.List<java.lang.String> getUserResourcesList​(java.lang.String archOs)
                                                              throws java.io.IOException
        Walks through the jars in the classpath, and looks for META-INF/substrate/config/resourceconfig or META-INF/substrate/config/resourceconfig-${archos} files. The method will return a list of lines from all the files found
        Parameters:
        archOs - a string with the arch and os, it can be null
        Returns:
        a list of lines that should be added to the resourceconfig.json file
        Throws:
        java.io.IOException