Gets the adapter.

@param <E> the element type
@param clazz the clazz
@return the adapter
161472
public static <E extends SqlTypeAdapter<?, ?>> E getAdapter(Class<E> clazz) {
		@SuppressWarnings("unchecked")
		E adapter = (E) cache.get(clazz);

		if (adapter == null) {
			try {
				lock.lock();
				adapter = clazz.newInstance();
				cache.put(clazz, adapter);
			} catch(Throwable e) {
				throw(new KriptonRuntimeException(e));
			} finally {
				lock.unlock();
			}
		}

		return adapter;
	}
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();
    }
1305360
public static <TYPE> Provider<TYPE> of(final Class<TYPE> clazz,
            @Nullable final Map<String, String> overrides)
    {
        return of(null, clazz, overrides);
    }
816102
public ClassDocImpl getClassDoc(ClassSymbol clazz) {
        ClassDocImpl result = classMap.get(clazz);
        if (result != null) return result;
        if (isAnnotationType(clazz)) {
            result = new AnnotationTypeDocImpl(this, clazz);
        } else {
            result = new ClassDocImpl(this, clazz);
        }
        classMap.put(clazz, result);
        return result;
    }
19573
protected Class<?> loadClass(String clazz) throws ClassNotFoundException {
		if (this.classLoader == null){
			return Class.forName(clazz);
		}

		return Class.forName(clazz, true, this.classLoader);

	}
802863
public static Class<?> getCollectionClass (Class<?> clazz)
    {
        if (Streamable.class.isAssignableFrom(clazz)) {
            // the class is natively streamable, let's ignore it
            return null;
        }
        for (Class<?> collClass : BasicStreamers.CollectionStreamer.SPECIFICITY_ORDER) {
            if (collClass.isAssignableFrom(clazz)) {
                return collClass;
            }
        }
        return null;
    }
1264978
public static Field getOptionalField(Class<?> clazz, String fieldName)
  {
    try {
      Field field = clazz.getDeclaredField(fieldName);
      field.setAccessible(true);
      return field;
    }
    catch(NoSuchFieldException expectable) {}
    catch(SecurityException e) {
      throw new BugError(e);
    }
    return null;
  }
153864
public <E extends Element> List<E> filterElements(Class<E> clazz) {
		synchronized(lock) {
			if(elements == null) return Collections.emptyList();
			return AoCollections.filter(elements, clazz);
		}
	}
1346759
@SuppressWarnings({ "unchecked", "rawtypes" })
    public Option<Adapter<V>> get(final K key) {
        return Option.ofNullable((Adapter) registered.get(key));
    }
205943
private static Method getMethod(String methodName, Class<?> clazz, Class<?>... args) {
        Method method;
        try {
            method = clazz.getMethod(methodName, args);
        } catch (NoSuchMethodException e1) {
            method = null;
        }
        return method;
    }
713775
public <T> TypeAdapter<T> getAdapter(Class<T> type) {
    return getAdapter(TypeToken.get(type));
  }
59803
public static <D, J> J toJava(Class<? extends PreferenceTypeAdapter<J, D>> clazz, D value) {
		@SuppressWarnings("unchecked")
		PreferenceTypeAdapter<J, D> adapter = cache.get(clazz);

		if (adapter == null) {
			adapter = generateAdapter(clazz);
		}

		return adapter.toJava(value);
	}
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;
    }
105894
public int getCodec(final Class<?> clazz) {
    if (clazz == null) {
      throw new IllegalArgumentException("Clazz cannot be null.");
    }
    final Integer id = codecs_ids.get(clazz);
    if (id == null) {
      throw new IllegalArgumentException("No codec ID assigned to class " 
          + clazz);
    }
    return id;
  }
1130105
public static Class<?> getPrimitiveClass(final Class<?> clazz) {

    if (clazz == null) {
      return null;
    }
    int index = ArrayUtils.indexOf(WRAPPER_CLASSES, clazz);
    if (index != ArrayUtils.INDEX_OF_NOT_FOUND) {
      return PRIMITIVE_CLASSES[index];
    }
    return clazz;
  }
532695
@SuppressWarnings("unchecked")
    public static PropertyAccessor getPropertyAccessor(Class<?> clazz)
    {
        PropertyAccessor<?> accessor;
        if (clazz.isEnum())
        {
            accessor = new EnumAccessor();
        }
        else
        {
            accessor = map.get(clazz);
        }

        // allow fall-back to Object streamer.
        if (null == accessor)
        {
            if (Enum.class.isAssignableFrom(clazz))
            {
                accessor = map.get(Enum.class);
            }
            else
            {
                accessor = map.get(Object.class);
            }

        }
        return accessor;
    }
1185501
public static <T> T getBean(Class<T> clazz) {
        ApplicationContext appContext = getAppContext();
        
        try {
            return appContext == null ? null : appContext.getBean(clazz);
        } catch (Exception e) {
            return null;
        }
    }