Class ExampleUtil


  • public class ExampleUtil
    extends java.lang.Object
    Utility methods used by examples.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void addClass​(ClassPool classPool, java.lang.Class<?>... classes)
      Add the given Java Classes to a ClassPool.
      static ClassPool createClassPool​(java.lang.Class<?>... classes)
      Create a ClassPool for the given Java Classes.
      static java.lang.Object executeMainMethod​(ClassPool classPool, java.lang.String internalClassName)
      Execute the "main" method of a ProGuardCORE class in the given ClassPool with the specified name.
      static java.lang.Object executeMainMethod​(ClassPool classPool, java.lang.String internalClassName, java.lang.String... arguments)
      Execute the "main" method of a ProGuardCORE class in the given ClassPool with the specified name and the specified arguments.
      static java.lang.Object executeMainMethod​(ProgramClass programClass)
      Execute the "main" method of a ProGuardCORE ProgramClass.
      static java.lang.Object executeMethod​(ClassPool classPool, java.lang.String internalClassName, java.lang.String methodName, java.lang.Class<?>[] parameterTypes, java.lang.Object[] arguments)
      Execute the specified method of a ProGuardCORE class in the given ClassPool with the specified name and the specified arguments.
      • Methods inherited from class java.lang.Object

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

      • createClassPool

        public static ClassPool createClassPool​(java.lang.Class<?>... classes)
        Create a ClassPool for the given Java Classes.
      • addClass

        public static void addClass​(ClassPool classPool,
                                    java.lang.Class<?>... classes)
        Add the given Java Classes to a ClassPool.
      • executeMainMethod

        public static java.lang.Object executeMainMethod​(ProgramClass programClass)
        Execute the "main" method of a ProGuardCORE ProgramClass.
      • executeMainMethod

        public static java.lang.Object executeMainMethod​(ClassPool classPool,
                                                         java.lang.String internalClassName)
        Execute the "main" method of a ProGuardCORE class in the given ClassPool with the specified name.
      • executeMainMethod

        public static java.lang.Object executeMainMethod​(ClassPool classPool,
                                                         java.lang.String internalClassName,
                                                         java.lang.String... arguments)
        Execute the "main" method of a ProGuardCORE class in the given ClassPool with the specified name and the specified arguments.
      • executeMethod

        public static java.lang.Object executeMethod​(ClassPool classPool,
                                                     java.lang.String internalClassName,
                                                     java.lang.String methodName,
                                                     java.lang.Class<?>[] parameterTypes,
                                                     java.lang.Object[] arguments)
                                              throws java.lang.ClassNotFoundException,
                                                     java.lang.NoSuchMethodException,
                                                     java.lang.reflect.InvocationTargetException,
                                                     java.lang.IllegalAccessException
        Execute the specified method of a ProGuardCORE class in the given ClassPool with the specified name and the specified arguments.
        Throws:
        java.lang.ClassNotFoundException
        java.lang.NoSuchMethodException
        java.lang.reflect.InvocationTargetException
        java.lang.IllegalAccessException