Instantiate class associated to the given property key

@param propertyKey property key
@param <T>         class parameter type
@return class instance
12113
private <T> T instantiateClass(PropertyKey propertyKey) {
        T object = null;
        String property = properties.getProperty(propertyKey.getKey());
        if (property != null) {
            try {
                Class<T> clazz = ClassLoaderUtils.loadClass(property);
                LOGGER.debug("Instantiate {}", clazz);
                object = clazz.newInstance();
            } catch (ClassNotFoundException e) {
                LOGGER.error("Couldn't load the " + property + " class given by the " + propertyKey + " property", e);
            } catch (InstantiationException e) {
                LOGGER.error("Couldn't instantiate the " + property + " class given by the " + propertyKey + " property", e);
            } catch (IllegalAccessException e) {
                LOGGER.error("Couldn't access the " + property + " class given by the " + propertyKey + " property", e);
            }
        }
        return object;
    }
232561
@Deprecated
    public <T> Class<T> getPropertyAsClass(String key, Class<T> targetType) {
        Optional<String> property = propertyResolver.getProperty(NameUtils.hyphenate(key), String.class);
        if (property.isPresent()) {
            Optional<Class> aClass = ClassUtils.forName(property.get(), Thread.currentThread().getContextClassLoader());
            if (aClass.isPresent()) {
                //noinspection unchecked
                return aClass.get();
            }
        }
        return null;
    }
488962
public <TYPE> TYPE get(String key, Class<TYPE> type) {
		return cache.get(key, type);
	}
320459
@NotNull
    public static <T> Key<T> create(@NotNull String name, @NotNull Class<T> type) {
        return new Key<>(name, type);
    }
709770
public Object getProperty(PropertyKey key)
    {
        //
        // Delegate up to any parent map
        //
        if (_delegateMap != null)
            return _delegateMap.getProperty(key);

        //
        // If neither found a value, return the default value
        //
        return key.getDefaultValue();
    }
1046418
public MethodKey createCopy() {
        int size = getParameterCount();
        Class[] paramTypes = new Class[size];
        for (int i = 0; i < size; i++) {
            paramTypes[i] = getParameterType(i);
        }
        return new DefaultMethodKey(sender, name, paramTypes, isCallToSuper);
    }
1355223
public Object getProperty(PropertyKey key)
    {
        if (!isValidKey(key))
            throw new IllegalArgumentException("Key " + key + " is not valid for " + _mapClass);


        //
        // Look for the property value on the associated annotated element
        //
        Class propertySet = key.getPropertySet();
        Annotation annot = _annotElem.getAnnotation(propertySet);
        if (annot != null)
            return key.extractValue(annot);

        //
        // If the property supports inheritance and the annotated element is an interface,
        // then we'll search up the ControlInheritance/Extension hierachy to see if it is
        // provided higher up the chain.
        //
        if (propertySet.isAnnotationPresent(Inherited.class) && _annotElem instanceof Class)
        {
            Class controlIntf = (Class)_annotElem;
            do
            {
                Class [] superIntfs = controlIntf.getInterfaces();
                controlIntf = null;
                for (int i = 0; i < superIntfs.length; i++)
                {
                    if (superIntfs[i].isAnnotationPresent(ControlInterface.class) ||
                        superIntfs[i].isAnnotationPresent(ControlExtension.class))
                    {
                        controlIntf = superIntfs[i];
                        annot = controlIntf.getAnnotation(propertySet);
                        if (annot != null)
                            return key.extractValue(annot);
                    }
                }

            }
            while (controlIntf != null);
        }

        //
        // Call up to superclass for delegation / default value
        //
        return super.getProperty(key);
    }
1073467
protected Map<PropertyKey, Object> properties() {

        if (properties == null) {
            properties = new EnumMap<>(PropertyKey.class);
        }

        return properties;
    }
1136445
private <T> T getTyped(PropertyKey key, Class<T> clazz) {
        Property p = getProperty(key.m_key);
        
        if (null == p || null == p.getData()) {
            return clazz.cast(m_defaults.get(key));
        }

        return clazz.cast(p.getData());
    }
1361678
private Mapper createMapper(Type type) {
    lock.lock();
    try {
      Mapper mapper = cache.get(type);
      if (mapper != null) {
        return mapper;
      }
      if (type instanceof Class) {
        mapper = createMapper((Class<?>) type);
      } else if (type instanceof ParameterizedType) {
        mapper = createMapper((ParameterizedType) type);
      } else {
        throw new IllegalArgumentException(
            String.format("Type %s is neither a Class nor ParameterizedType", type));
      }
      cache.put(type, mapper);
      return mapper;
    } finally {
      lock.unlock();
    }
  }
201163
public static <T> Key<T> of(Class<T> type,
                              Class<? extends Annotation> annType)
  {
    Objects.requireNonNull(type);
    Objects.requireNonNull(annType);

    return new Key<>(type, new Class[] { annType });
  }
60440
public <T> T get(String key, Class<T> type) {
        Object value = this.data.get(key);
        if (value != null && type.isAssignableFrom(value.getClass())) {
            return (T) value;
        }
        return null;
    }
577925
private <T> Provider<T> createProvider(Key<T> key)
  {
    Class<T> type = (Class<T>) key.rawClass();

    if (Provider.class.equals(type)) {
      TypeRef subType = TypeRef.of(key.type()).to(Provider.class).param(0);

      Key<Object> subkey = Key.of(subType.type(), key.annotationTypes());

      return (Provider) new ProviderProvider(key, -10, provider(subkey));
    }
    else if (Optional.class.equals(type)) {
      TypeRef subType = TypeRef.of(key.type()).to(Optional.class).param(0);

      Key<Object> subkey = Key.of(subType.type(), key.annotationTypes());

      return (Provider) new ProviderOptional(key, -10, provider(subkey));
    }
    else if (type.isInterface() || Modifier.isAbstract(type.getModifiers())) {
      return new ProviderNull(key, -10000, new InjectScopeSingleton());
    }

    int priority = -10;

    // auto-provider is factory
    InjectScope<T> scope = findScope(type);

    BindingAmp<T> binding = new ProviderConstructor<>(this, key, priority, scope, type);

    binding.bind();

    return binding.provider();
  }
817146
public static <T> T newInstance(Class<T> aClass)
    {
        try
        {
            return aClass.getConstructor().newInstance();
        }
        catch (InstantiationException e)
        {
            throw new RuntimeException(e);
        }
        catch (IllegalAccessException e)
        {
            throw new RuntimeException(e);
        }
        catch (NoSuchMethodException e)
        {
            throw new RuntimeException(e);
        }
        catch (InvocationTargetException e)
        {
            throw new RuntimeException(e);
        }
    }
783129
@Override
  public <T> T instance(Key<T> key)
  {
    Objects.requireNonNull(key);

    Class<T> type = (Class) key.rawClass();
    if (type.equals(Provider.class)) {
      TypeRef typeRef = TypeRef.of(key.type());
      TypeRef param = typeRef.param(0);

      return (T) provider(Key.of(param.type()));
    }


    Provider<T> provider = provider(key);

    if (provider != null) {
      return provider.get();
    }
    else {
      return null;
    }
  }
1266267
public static Class<?> getPropertyClass(Class<?> clazz, List<String> propertyPath) {
		Class<?> current = clazz;
		for (String propertyName : propertyPath) {
			current = getPropertyClass(current, propertyName);
		}
		return current;
	}
142389
public static <E extends Enum<E>> EnumKeyDeserializer<E> newInstance( Class<E> enumClass ) {
        return new EnumKeyDeserializer<E>( enumClass );
    }