Class ClassDefining


  • public final class ClassDefining
    extends java.lang.Object
    Entry-point for defining dynamically generated classes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String CLASS_DEFINING_UNSUPPORTED  
      private static java.util.logging.Logger logger  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ClassDefining()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static ClassDefiner bindClassDefiner()
      Binds the preferred ClassDefiner instance.
      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
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • CLASS_DEFINING_UNSUPPORTED

        private static final java.lang.String CLASS_DEFINING_UNSUPPORTED
        See Also:
        Constant Field Values
    • Constructor Detail

      • ClassDefining

        private ClassDefining()
    • 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.