Enum ClassInjector.UsingInstrumentation.Target

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOOTSTRAP
      Representation of the bootstrap class loader.
      SYSTEM
      Representation of the system class loader.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.ClassLoader classLoader
      The class loader to load classes from.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Target​(java.lang.ClassLoader classLoader)
      Creates a new injection target.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.ClassLoader getClassLoader()
      Returns the class loader to load classes from.
      protected abstract void inject​(java.lang.instrument.Instrumentation instrumentation, java.util.jar.JarFile jarFile)
      Adds the given classes to the represented class loader.
      static ClassInjector.UsingInstrumentation.Target valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ClassInjector.UsingInstrumentation.Target[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • classLoader

        private final java.lang.ClassLoader classLoader
        The class loader to load classes from.
    • Constructor Detail

      • Target

        private Target​(java.lang.ClassLoader classLoader)
        Creates a new injection target.
        Parameters:
        classLoader - The class loader to load classes from.
    • Method Detail

      • values

        public static ClassInjector.UsingInstrumentation.Target[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ClassInjector.UsingInstrumentation.Target c : ClassInjector.UsingInstrumentation.Target.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ClassInjector.UsingInstrumentation.Target valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getClassLoader

        protected java.lang.ClassLoader getClassLoader()
        Returns the class loader to load classes from.
        Returns:
        The class loader to load classes from.
      • inject

        protected abstract void inject​(java.lang.instrument.Instrumentation instrumentation,
                                       java.util.jar.JarFile jarFile)
        Adds the given classes to the represented class loader.
        Parameters:
        instrumentation - The instrumentation instance to use.
        jarFile - The jar file to append.