class FieldInjectorImpl implements FieldInjector {

    @Override
    public void inject(Object resource, ApplicationContext context) {
        try {
            Object value = null;
            if (annotation != null) {
                value = parameterResolverFactory.createParameterResolver(annotation).resolve(this, context);
            } else {
                DependencySupplier dependencies = context.getDependencySupplier();
                if (dependencies != null) {
                    value = dependencies.getInstance(this);
                }
            }

            if (value != null) {
                if (setter != null) {
                    setter.invoke(resource, value);
                } else {
                    if (!Modifier.isPublic(field.getModifiers())) {
                        field.setAccessible(true);
                    }
                    field.set(resource, value);
                }
            }
        } catch (Exception e) {
            if (annotation != null) {
                Class<?> annotationType = annotation.annotationType();
                if (annotationType == PathParam.class || annotationType == QueryParam.class || annotationType == MatrixParam.class) {
                    throw new WebApplicationException(e, Response.status(NOT_FOUND).build());
                }
                throw new WebApplicationException(e, Response.status(BAD_REQUEST).build());
            }
            throw new WebApplicationException(e, Response.status(INTERNAL_SERVER_ERROR).build());
        }
    }

    public  FieldInjectorImpl(Field field, ParameterResolverFactory parameterResolverFactory);

}