Class ClassDefining


  • public final class ClassDefining
    extends java.lang.Object
    Entry-point for defining dynamically generated classes.
    Author:
    mcculls@gmail.com (Stuart McCulloch)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canDowncastToProxy​(java.lang.Class<?> hostClass)
      Returns true if it's possible to downcast to proxies defined from the given host.
      static boolean canLoadProxyByName​(java.lang.Class<?> hostClass)
      Returns true if it's possible to load by name proxies defined from the given host.
      static java.lang.Class<?> define​(java.lang.Class<?> hostClass, byte[] bytecode)
      Defines a new class relative to the host.
      static boolean hasPackageAccess()
      Returns true if the current class definer allows access to package-private members.
      • Methods inherited from class java.lang.Object

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

      • define

        public static java.lang.Class<?> define​(java.lang.Class<?> hostClass,
                                                byte[] bytecode)
                                         throws java.lang.Exception
        Defines a new class relative to the host.
        Throws:
        java.lang.Exception
      • hasPackageAccess

        public static boolean hasPackageAccess()
        Returns true if the current class definer allows access to package-private members.
      • canLoadProxyByName

        public static boolean canLoadProxyByName​(java.lang.Class<?> hostClass)
        Returns true if it's possible to load by name proxies defined from the given host.
      • canDowncastToProxy

        public static boolean canDowncastToProxy​(java.lang.Class<?> hostClass)
        Returns true if it's possible to downcast to proxies defined from the given host.