Get the introspected properties for a class
@param clz The fully qualified class name
@param cl classloader
@return The properties (name, type)
195644
private static Map<String, String> getIntrospectedProperties(String clz, URLClassLoader cl, PrintStream error)
   {
      Map<String, String> result = null;

      try
      {
         Class<?> c = Class.forName(clz, true, cl);

         result = new TreeMap<String, String>();

         Method[] methods = c.getMethods();

         for (Method m : methods)
         {
            if (m.getName().startsWith("set") && m.getParameterTypes().length == 1
                  && isValidType(m.getParameterTypes()[0]))
            {
               String name = m.getName().substring(3);

               if (name.length() == 1)
               {
                  name = name.toLowerCase(Locale.US);
               }
               else
               {
                  name = name.substring(0, 1).toLowerCase(Locale.US) + name.substring(1);
               }

               String type = m.getParameterTypes()[0].getName();

               result.put(name, type);
            }
         }
      }
      catch (Throwable t)
      {
         // Nothing we can do
         t.printStackTrace(error);
      }
      return result;
   }
514532
public static Properties loadProperties(final Class<?> clasz, final String filename) {
        checkNotNull("clasz", clasz);
        checkNotNull("filename", filename);

        final String path = getPackagePath(clasz);
        final String resPath = path + "/" + filename;
        return loadProperties(clasz.getClassLoader(), resPath);

    }
668261
public static ClassLoader getClassLoader(Class<?> clazz) {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        if (loader != null) {
            return loader;
        }
        if (clazz != null) {
            loader = clazz.getClassLoader();
            if (loader != null) {
                return loader;
            }
        }
        return ClassLoader.getSystemClassLoader();
    }
265858
public Field getIdentityProperty(Class clazz) {
        Field info = _idPropertyCache.get(clazz);
        if (info != null) {
            return info;
        }

        try {
            Field idField = Arrays.stream(Introspector.getBeanInfo(clazz).getPropertyDescriptors())
                    .filter(x -> _findIdentityProperty.apply(x))
                    .findFirst()
                    .map(x -> getField(clazz, x.getName()))
                    .orElse(null);

            _idPropertyCache.put(clazz, idField);

            return idField;
        } catch (IntrospectionException e) {
            throw new RuntimeException(e);
        }
    }
269197
public synchronized static TypeDesc forClass(Class<?> clazz) {
        if (clazz == null) {
            return null;
        }

        TypeDesc type = cClassesToInstances.get(clazz);
        if (type != null) {
            return type;
        }

        if (clazz.isArray()) {
            type = forClass(clazz.getComponentType()).toArrayType();
        }
        else if (clazz.isPrimitive()) {
            if (clazz == int.class) {
                type = INT;
            }
            if (clazz == boolean.class) {
                type = BOOLEAN;
            }
            if (clazz == char.class) {
                type = CHAR;
            }
            if (clazz == byte.class) {
                type = BYTE;
            }
            if (clazz == long.class) {
                type = LONG;
            }
            if (clazz == float.class) {
                type = FLOAT;
            }
            if (clazz == double.class) {
                type = DOUBLE;
            }
            if (clazz == short.class) {
                type = SHORT;
            }
            if (clazz == void.class) {
                type = VOID;
            }
        }
        else {
            String name = clazz.getName();
            type = intern(new ObjectType(generateDescriptor(name), name));
        }

        cClassesToInstances.put(clazz, type);
        return type;
    }
1018110
public static <C extends Configurable> C getConfiguration(Class<C> klass) {
        String defaultPropertyFile = "datumbox." + klass.getSimpleName().toLowerCase(Locale.ENGLISH) + DEFAULT_POSTFIX + ".properties";

        Properties properties = new Properties();
        
        ClassLoader cl = klass.getClassLoader();
        
        //Load default properties from jar
        try (InputStream in = cl.getResourceAsStream(defaultPropertyFile)) {
            properties.load(in);
        }
        catch(IOException ex) {
            throw new UncheckedIOException(ex);
        }
        
        //Look for user defined properties
        String propertyFile = defaultPropertyFile.replaceFirst(DEFAULT_POSTFIX, "");
        if(cl.getResource(propertyFile)!=null) {
            //Override the default if they exist
            try (InputStream in = cl.getResourceAsStream(propertyFile)) {
                properties.load(in);
            }
            catch(IOException ex) {
                throw new UncheckedIOException(ex);
            }
            logger.trace("Loading properties file {}: {}", propertyFile, properties);
        }
        else {
            logger.warn("Using default properties file {}: {}", defaultPropertyFile, properties);
        }

        return getConfiguration(klass, properties);
    }
630625
public static Class<?> getPropertyType( Clazz<?> clazz, String name )
	{
		return propertyValues.getPropertyType(clazz, name);
	}
582128
public Config getConfig(Class<?> clazz) {
        Config config = DEFAULT_CONFIG;

        Config globalConfig = Config.Implementation.fromProperties(getConfigProperties());
        if (globalConfig != null) {
            config = new Config.Implementation(config, globalConfig);
        }

        Config classConfig = clazz.getAnnotation(Config.class);
        if (classConfig != null) {
            config = new Config.Implementation(config, classConfig);
        }

        return config;
    }
1255847
public static List<JobPropertyDescriptor> getPropertyDescriptors(Class<? extends Job> clazz) {
        List<JobPropertyDescriptor> r = new ArrayList<>();
        for (JobPropertyDescriptor p : all())
            if(p.isApplicable(clazz))
                r.add(p);
        return r;
    }
499615
public static @CheckForNull Class<?> _findLoadedClass(ClassLoader cl, String name) {
        synchronized (getClassLoadingLock(cl, name)) {
            return (Class) invoke(FIND_LOADED_CLASS, RuntimeException.class, cl, name);
        }
    }
186146
private static String discoverClassName(ClassLoader tccl) {
        String className = null;

        // First services API
        className = getClassNameServices(tccl);
        if (className == null) {
            if (IS_SECURITY_ENABLED) {
                className = AccessController.doPrivileged(
                                new PrivilegedAction<String>() {
                                    @Override
                                    public String run() {
                                        return getClassNameJreDir();
                                    }
                                }
                                );
            } else {
                // Second el.properties file
                className = getClassNameJreDir();
            }
        }
        if (className == null) {
            if (IS_SECURITY_ENABLED) {
                className = AccessController.doPrivileged(
                                new PrivilegedAction<String>() {
                                    @Override
                                    public String run() {
                                        return getClassNameSysProp();
                                    }
                                }
                                );
            } else {
                // Third system property
                className = getClassNameSysProp();
            }
        }
        if (className == null) {
            // Fourth - default
            className = "org.apache.el.ExpressionFactoryImpl";
        }
        return className;
    }
508051
public <T extends ICalProperty> List<T> getProperties(Class<T> clazz) {
		return new ICalPropertyList<T>(clazz);
	}
660548
public static Class<?>[] getDeclaredClasses(Class<?> clazz) {
        assertReflectionAccessor();
        try {
            return accessor.getDeclaredClasses(clazz);
        } catch (Exception e) {
            throw SneakyException.sneakyThrow(e);
        }
    }
619698
public static final DataGridConfig getInstance(Class clazz) {
        DataGridConfig config = (DataGridConfig)ExtensionUtil.instantiateClass(clazz, DataGridConfig.class);
        return config;
    }
1060241
public static Class<?>[] getAllSuperClasses(Class<?> clz) {
    List<Class<?>> list = new ArrayList<>();
    while ((clz = clz.getSuperclass()) != null) {
      list.add(clz);
    }
    return list.toArray(new Class<?>[list.size()]);
  }
1169280
public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> clazz) {
        return getExtensionLoader(clazz, null);
    }
1112086
public static CustomPropertyDescriptor[] getPropertyDescriptors(Class<?> clazz) throws NullPointerException {
        if (clazz == null) {
            throw new NullPointerException("clazz为null");
        }
        // 首先从缓存中检查
        CustomPropertyDescriptor[] descriptors = CACHE.get(clazz);
        if (descriptors != null) {
            log.debug("获取Class {} 的说明时发现缓存中有，取出缓存中的说明返回", clazz);
            return descriptors;
        }

        Field[] fields = getAllFields(clazz);

        descriptors = new CustomPropertyDescriptor[fields.length];
        if (fields.length == 0) {
            log.debug("源{}中不存在已经声明的字段", clazz.getName());
            CACHE.put(clazz, descriptors);
            return descriptors;
        }

        int j = 0;
        for (Field field : fields) {
            CustomPropertyDescriptor descriptor = buildDescriptor(field, clazz);
            if (descriptor != null) {
                descriptors[j++] = descriptor;
            }
        }

        if (j < descriptors.length) {
            log.debug("构建构成中发生了异常，数组中有null，除去null");
            CustomPropertyDescriptor[] propertyDescriptor = new CustomPropertyDescriptor[j];
            System.arraycopy(descriptors, 0, propertyDescriptor, 0, j);
            CACHE.put(clazz, propertyDescriptor);
            return propertyDescriptor;
        } else {
            log.debug("构建没有异常，构建成功");
            CACHE.put(clazz, descriptors);
            return descriptors;
        }
    }