Class Desc


  • public class Desc
    extends java.lang.Object
    A support class for implementing $sig and $type. This support class is required at runtime only if $sig or $type is used.
    • Constructor Summary

      Constructors 
      Constructor Description
      Desc()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.Class<?> getClassObject​(java.lang.String name)  
      private static java.lang.Class<?>[] getClassType​(java.lang.String desc, int descLen, int start, int num)  
      static java.lang.Class<?> getClazz​(java.lang.String name)
      Interprets the given class name.
      static java.lang.Class<?>[] getParams​(java.lang.String desc)
      Interprets the given type descriptor representing a method signature.
      static java.lang.Class<?> getType​(java.lang.String desc)
      Interprets the given type descriptor.
      private static java.lang.Class<?>[] getType​(java.lang.String desc, int descLen, int start, int num)  
      static void resetUseContextClassLoaderLocally()
      Changes so that the current thread will not use the context class loader when a class is loaded.
      static void setUseContextClassLoaderLocally()
      Changes so that the current thread will use the context class loader when a class is loaded.
      • Methods inherited from class java.lang.Object

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

      • useContextClassLoader

        public static boolean useContextClassLoader
        Specifies how a java.lang.Class object is loaded.

        If true, it is loaded by:

        Thread.currentThread().getContextClassLoader().loadClass()

        If false, it is loaded by Class.forName(). The default value is false.

      • USE_CONTEXT_CLASS_LOADER_LOCALLY

        private static final java.lang.ThreadLocal<java.lang.Boolean> USE_CONTEXT_CLASS_LOADER_LOCALLY
    • Constructor Detail

      • Desc

        public Desc()
    • Method Detail

      • setUseContextClassLoaderLocally

        public static void setUseContextClassLoaderLocally()
        Changes so that the current thread will use the context class loader when a class is loaded. This method changes the behavior per thread unlike useContextClassLoader.
        Since:
        3.25
      • resetUseContextClassLoaderLocally

        public static void resetUseContextClassLoaderLocally()
        Changes so that the current thread will not use the context class loader when a class is loaded. Call this method before releasing the current thread for reuse. It invokes ThreadLocal.remvoe().
        Since:
        3.25
      • getClassObject

        private static java.lang.Class<?> getClassObject​(java.lang.String name)
                                                  throws java.lang.ClassNotFoundException
        Throws:
        java.lang.ClassNotFoundException
      • getClazz

        public static java.lang.Class<?> getClazz​(java.lang.String name)
        Interprets the given class name. It is used for implementing $class.
      • getParams

        public static java.lang.Class<?>[] getParams​(java.lang.String desc)
        Interprets the given type descriptor representing a method signature. It is used for implementing $sig.
      • getType

        public static java.lang.Class<?> getType​(java.lang.String desc)
        Interprets the given type descriptor. It is used for implementing $type.
      • getType

        private static java.lang.Class<?>[] getType​(java.lang.String desc,
                                                    int descLen,
                                                    int start,
                                                    int num)
      • getClassType

        private static java.lang.Class<?>[] getClassType​(java.lang.String desc,
                                                         int descLen,
                                                         int start,
                                                         int num)