Internal method!

Create a {@link VariableResolver} that contains the implicit objects available for
expression reads.

@param jspContext the jsp context
@return the variable resolver
169157
public static VariableResolver getReadVariableResolver(JspContext jspContext) {
        assert jspContext != null;

        /* todo: ugly ugly ugly...getting the appropriate variable resolver should be easier than this */
        Object actionForm = getActionForm(((PageContext)jspContext).getRequest());

        NetUIReadVariableResolver netuiVariableResolver =
            new NetUIReadVariableResolver(jspContext.getVariableResolver());
        netuiVariableResolver.setActionForm(unwrapForm(actionForm));

        return netuiVariableResolver;
    }
105826
protected Object resolveSimpleComponent(String exp, Map<String, ? extends Object> contextMap, LaContainer container,
            Class<?> resultType) {
        if (!LdiSrl.containsAny(exp, ".", ",", SQ, DQ, "@", "#")) { // main except, just in case
            if (container.hasComponentDef(exp)) {
                return container.getComponent(exp);
            }
        }
        return null;
    }
93746
@Nullable
	public Properties getProperties(EnvVars envVars,
									VariableResolver<String> varResolver) {
		return createProperties(envVars, varResolver);
	}
784137
@SuppressWarnings("rawtypes")
    public Class resolveTypeVariable(Class<?> declaringClass, String typeVarName) {
        return GenericUtils.resolveTypeVariable(daoClass, declaringClass, typeVarName);
    }
317113
@Override
    ResolveResult<? extends AbstractConfigValue> resolveSubstitutions(ResolveContext context, ResolveSource source) {
        ResolveContext newContext = context.addCycleMarker(this);
        AbstractConfigValue v;
        try {
            ResolveSource.ResultWithPath resultWithPath = source.lookupSubst(newContext, expr, prefixLength);
            newContext = resultWithPath.result.context;

            if (resultWithPath.result.value != null) {
                if (ConfigImpl.traceSubstitutionsEnabled())
                    ConfigImpl.trace(newContext.depth(), "recursively resolving " + resultWithPath
                            + " which was the resolution of " + expr + " against " + source);

                ResolveSource recursiveResolveSource = (new ResolveSource(
                        (AbstractConfigObject) resultWithPath.pathFromRoot.last(), resultWithPath.pathFromRoot));

                if (ConfigImpl.traceSubstitutionsEnabled())
                    ConfigImpl.trace(newContext.depth(), "will recursively resolve against " + recursiveResolveSource);

                ResolveResult<? extends AbstractConfigValue> result = newContext.resolve(resultWithPath.result.value,
                        recursiveResolveSource);
                v = result.value;
                newContext = result.context;
            } else {
                ConfigValue fallback = context.options().getResolver().lookup(expr.path().render());
                v = (AbstractConfigValue) fallback;
            }
        } catch (NotPossibleToResolve e) {
            if (ConfigImpl.traceSubstitutionsEnabled())
                ConfigImpl.trace(newContext.depth(),
                        "not possible to resolve " + expr + ", cycle involved: " + e.traceString());
            if (expr.optional())
                v = null;
            else
                throw new ConfigException.UnresolvedSubstitution(origin(), expr
                        + " was part of a cycle of substitutions involving " + e.traceString(), e);
        }

        if (v == null && !expr.optional()) {
            if (newContext.options().getAllowUnresolved())
                return ResolveResult.make(newContext.removeCycleMarker(this), this);
            else
                throw new ConfigException.UnresolvedSubstitution(origin(), expr.toString());
        } else {
            return ResolveResult.make(newContext.removeCycleMarker(this), v);
        }
    }
1310002
@SuppressWarnings({ "unchecked", "rawtypes" })
    protected Type resolveType(Type type) {

        Map<TypeVariable, Type> map = new HashMap<>();
        map.putAll(getTypeVariableMap());

        return ResolvableType.forType(type, new TypeVariableMapVariableResolver(map)).getType();
    }
959774
public static VariableResolver getUpdateVariableResolver(ServletRequest request,
                                                             ServletResponse response,
                                                             boolean isHandlingPost) {
        Object form = ImplicitObjectUtil.unwrapForm(getActionForm(request));
        return new NetUIUpdateVariableResolver(form, request, response, isHandlingPost);
    }
426088
public Resolution intercept(ExecutionContext context) throws Exception {
        // Continue on and execute other filters and the lifecycle code.
        Resolution resolution = context.proceed();
        
        // Get all fields with session.
        Collection<Field> fields = getSessionFields(context.getActionBean().getClass());
        
        // Restores values from session.
        if (LifecycleStage.ActionBeanResolution.equals(context.getLifecycleStage())) {
            this.restoreFields(fields, context.getActionBean(), context.getActionBeanContext());
        }
        // Store values in session.
        if (LifecycleStage.EventHandling.equals(context.getLifecycleStage())) {
            // Dont't update values in session if a validation error occured.
            if (context.getActionBeanContext().getValidationErrors().isEmpty()) {
            	if (fields.size() > 0)
            		this.saveFields(fields, context.getActionBean(), context.getActionBeanContext().getRequest().getSession());
            }
        }
        
        return resolution;
    }
568983
public Object resolveProperty(Object object, List<String> propertyNames) {
    // Always wrap base object.
    Object value = resolver.wrap(object);

    for (String propertyName : propertyNames) {
      if (value == null) {
        return null;
      }

      value = resolver.getValue(elContext, value, propertyName);
    }

    return value;
  }
1337019
private ValueReference getValueReference(
            final ValueExpression valueExpression, final FacesContext context)
    {
        ELContext elCtx = context.getELContext();
        return _ValueReferenceResolver.resolve(valueExpression, elCtx);
    }
398492
private VariantResolver registerResolver(VariantResolver defaultResolver, String configPropertyName) {
		VariantResolver resolver = null;
		if (configProperties.getProperty(configPropertyName) == null) {
			resolver = defaultResolver;
		} else {
			resolver = (VariantResolver) ClassLoaderResourceUtils
					.buildObjectInstance(configProperties.getProperty(configPropertyName));
		}

		this.generatorRegistry.registerVariantResolver(resolver);
		return resolver;
	}
711935
private Object readResolve() throws ObjectStreamException {
		Constructor<?> compatible = null;
		for (final Constructor<?> candidate : this.proxyType.getDeclaredConstructors()) {
			if (candidate != null && isCompatible(candidate)) {
				if (compatible != null) {
					throw new IllegalStateException();
				}
				compatible = candidate;
			}
		}
		if (compatible != null) {
			if (!compatible.isAccessible()) {
				compatible.setAccessible(true);
			}
			try {
				final Object[] arguments = new Object[this.values.length + 1];
				System.arraycopy(this.values, 0, arguments, 1, this.values.length);
				return compatible.newInstance(arguments);
			} catch (Exception exception) {
				throw new WriteAbortedException(exception.getLocalizedMessage(), exception);
			}
		}
		throw new InvalidClassException("compatible constructor not found"); //$NON-NLS-1$
	}
558859
@SuppressWarnings({"unused", "unchecked"})
    @Internal
    protected final Object getValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex) {
        MethodInjectionPoint injectionPoint = methodInjectionPoints.get(methodIndex);
        Argument argument = injectionPoint.getArguments()[argIndex];
        BeanResolutionContext.Path path = resolutionContext.getPath();
        path.pushMethodArgumentResolve(this, injectionPoint, argument);
        if (context instanceof ApplicationContext) {
            // can't use orElseThrow here due to compiler bug
            try {
                String valueAnnStr = argument.getAnnotationMetadata().getValue(Value.class, String.class).orElse(null);
                Class argumentType = argument.getType();

                if (isInnerConfiguration(argumentType)) {
                    Qualifier qualifier = resolveQualifier(resolutionContext, argument, true);
                    return ((DefaultBeanContext) context).getBean(resolutionContext, argumentType, qualifier);
                } else {
                    String argumentName = argument.getName();
                    String valString = resolvePropertyValueName(resolutionContext, injectionPoint.getAnnotationMetadata(), argument, valueAnnStr);


                    ApplicationContext applicationContext = (ApplicationContext) context;
                    ArgumentConversionContext conversionContext = ConversionContext.of(argument);
                    Optional value = resolveValue(applicationContext, conversionContext, valueAnnStr != null, valString);
                    if (argumentType == Optional.class) {
                        return resolveOptionalObject(value);
                    } else {
                        if (value.isPresent()) {
                            return value.get();
                        } else {
                            if (argument.isDeclaredAnnotationPresent(Nullable.class)) {
                                return null;
                            }
                            throw new DependencyInjectionException(resolutionContext, injectionPoint, conversionContext, valString);
                        }
                    }
                }
            } finally {
                path.pop();
            }
        } else {
            path.pop();
            throw new DependencyInjectionException(resolutionContext, argument, "BeanContext must support property resolution");
        }
    }
385707
private void initEntityResolver() {
        final String entityResolveClazzName = System.getProperty( ExtensibleXmlParser.ENTITY_RESOLVER_PROPERTY_NAME );
        if ( entityResolveClazzName != null && entityResolveClazzName.length() > 0 ) {
            try {

                final Class entityResolverClazz = classLoader.loadClass( entityResolveClazzName );
                this.entityResolver = (EntityResolver) entityResolverClazz.newInstance();
            } catch ( final Exception ignoreIt ) {
            }
        }
    }
1126563
protected ITemplateResolver createTemplateResolver() {
        final ServletContextTemplateResolver resolver = newServletContextTemplateResolver();
        resolver.setPrefix(getHtmlViewPrefix());
        resolver.setTemplateMode(getTemplateMode());
        resolver.setCharacterEncoding(getEncoding());
        resolver.setCacheable(isCacheable());
        return resolver;
    }
1360791
public static Type resolve(Type type, Type declaringType, EntityType context) {
        Type resolved = unwrap(type);

        String varName = getVarName(resolved);
        if (varName != null) {
            resolved = resolveVar(resolved, varName, declaringType, context);
        } else if (!resolved.getParameters().isEmpty()) {
            resolved = resolveWithParameters(resolved, declaringType, context);
        }

        // rewrap entity type
        if (type instanceof EntityType) {
            if (!unwrap(type).equals(resolved)) {
                resolved = new EntityType(resolved, ((EntityType) type).getSuperTypes());
            } else {
                // reset to original type
                resolved = type;
            }
        }

        return resolved;
    }
350252
private void exposeVariables() throws JspTagException {

        if (deferredExpression == null) {
            /*
             * We need to support null items returned from next(); we
             * do this simply by passing such non-items through to the
             * scoped variable as effectively 'null' (that is, by calling
             * removeAttribute()).
             *
             * Also, just to be defensive, we handle the case of a null
             * 'status' object as well.
             *
             * We call getCurrent() and getLoopStatus() (instead of just using
             * 'item' and 'status') to bridge to subclasses correctly.
             * A subclass can override getCurrent() or getLoopStatus() but still
             * depend on our doStartTag() and doAfterBody(), which call this
             * method (exposeVariables()), to expose 'item' and 'status'
             * correctly.
             */
            if (itemId != null) {
                if (getCurrent() == null) {
                    pageContext.removeAttribute(itemId, PageContext.PAGE_SCOPE);
                } else {
                    pageContext.setAttribute(itemId, getCurrent());
                }
            }
        } else { //this is using a DeferredExpression
            ELContext myELContext = pageContext.getELContext();
            VariableMapper vm = myELContext.getVariableMapper();
            vm.setVariable(itemId, (ValueExpression) getCurrent());
        }
        if (statusId != null) {
            if (getLoopStatus() == null) {
                pageContext.removeAttribute(statusId, PageContext.PAGE_SCOPE);
            } else {
                pageContext.setAttribute(statusId, getLoopStatus());
            }
        }

    }