Get an ExpressionFactory instance for the specified context, using {@link ELContext#getContext(Class)}, and
setting such a context value, if not found, to {@link javax.el.ExpressionFactory#newInstance()}.

@param context
@return ExpressionFactory
356332
public static ExpressionFactory getExpressionFactory(ELContext context) {
        ExpressionFactory result = getContext(context, ExpressionFactory.class);
        if (result == null) {
            result = ExpressionFactory.newInstance();
            context.putContext(ExpressionFactory.class, result);
        }
        return result;
    }
25100
@Pure
	public static Object getContext() throws AndroidException {
		final Object ctx;
		synchronized (Android.class) {
			if (context == null) {
				throw new AndroidException();
			}
			ctx = context.get();
		}
		if (ctx == null) {
			throw new AndroidException();
		}
		return ctx;
	}
15004
protected ExpressionContextDescription getExpressionContextDescription() {
		for (final CodeElementExtractor.ElementDescription containerDescription : getCodeElementExtractor().getTopElements(
				getGrammar(), getCodeBuilderConfig())) {
			final AbstractRule rule = getMemberRule(containerDescription);
			if (rule != null) {
				final Pattern fieldTypePattern = Pattern.compile(getExpressionConfig().getExpressionFieldTypenamePattern());
				final ExpressionContextDescription description = getCodeElementExtractor().visitMemberElements(
						containerDescription, rule, null,
					(it, grammarContainer, memberContainer, classifier) -> {
						if (fieldTypePattern.matcher(classifier.getName()).find()) {
							final Assignment expressionAssignment = findAssignmentFromTerminalPattern(
									memberContainer,
									getExpressionConfig().getExpressionGrammarPattern());
							final CodeElementExtractor.ElementDescription memberDescription =
									it.newElementDescription(classifier.getName(), memberContainer,
											classifier, XExpression.class);
							return new ExpressionContextDescription(
									containerDescription,
									memberDescription,
									ensureContainerKeyword(containerDescription.getGrammarComponent()),
									ensureFieldDeclarationKeyword(memberDescription),
									expressionAssignment);
						}
						return null;
					},
					null);
				if (description != null) {
					return description;
				}
			}
		}
		return null;
	}
729069
@Override
    @SuppressFBWarnings(value = "UL_UNRELEASED_LOCK", justification = "False positive from FindBugs")
    public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
        if (!isActive()) {
            throw new ContextNotActiveException();
        }
        checkContextInitialized();
        final BeanStore beanStore = getBeanStore();
        if (beanStore == null) {
            return null;
        }
        if (contextual == null) {
            throw ContextLogger.LOG.contextualIsNull();
        }
        BeanIdentifier id = getId(contextual);
        ContextualInstance<T> beanInstance = beanStore.get(id);
        if (beanInstance != null) {
            return beanInstance.getInstance();
        } else if (creationalContext != null) {
            LockedBean lock = null;
            try {
                if (multithreaded) {
                    lock = beanStore.lock(id);
                    beanInstance = beanStore.get(id);
                    if (beanInstance != null) {
                        return beanInstance.getInstance();
                    }
                }
                T instance = contextual.create(creationalContext);
                if (instance != null) {
                    beanInstance = new SerializableContextualInstanceImpl<Contextual<T>, T>(contextual, instance, creationalContext, serviceRegistry.get(ContextualStore.class));
                    beanStore.put(id, beanInstance);
                }
                return instance;
            } finally {
                if (lock != null) {
                    lock.unlock();
                }
            }
        } else {
            return null;
        }
    }
1370908
private BeanDefinitionRegistry getBeanDefinitionRegistry(ApplicationContext context) {
		if (context instanceof BeanDefinitionRegistry) {
			return (BeanDefinitionRegistry) context;
		}
		if (context instanceof AbstractApplicationContext) {
			return (BeanDefinitionRegistry) ((AbstractApplicationContext) context)
					.getBeanFactory();
		}
		throw new IllegalStateException("Could not locate BeanDefinitionRegistry");
	}
616686
public Class getType(FacesContext context) throws EvaluationException,
            PropertyNotFoundException {
            
        if (context == null) {
	        throw new NullPointerException("FacesContext -> null");
        }
        Class result = null;
        try {
            result = valueExpression.getType(context.getELContext());
        } catch (javax.el.PropertyNotFoundException pnfe) {
            throw new PropertyNotFoundException(pnfe);
        } catch (ELException elex) {
            throw new EvaluationException(elex);
        } 
        return result;
    }
985799
public static Log instance(Context context) {
        Log instance = context.get(logKey);
        if (instance == null)
            instance = new Log(context);
        return instance;
    }
306202
public synchronized ContainerRegistryBuilder createContainerBuilder(AppContextWrapper context) {
		containerLoaderAnnotation.startScan(context);

		ContainerFactory containerFactory = new ContainerFactory();
		ContainerWrapper cw = containerFactory.create(containerLoaderAnnotation.getConfigInfo());

		ContainerComponents configComponents = containerLoaderXML.loadAllContainerConfig(context);
		ContainerComponents aspectConfigComponents = containerLoaderXML.loadAllAspectConfig(context);

		return createContainerBuilder(context, cw, configComponents, aspectConfigComponents);
	}
849136
public static Arguments instance(Context context) {
        Arguments instance = context.get(argsKey);
        if (instance == null) {
            instance = new Arguments(context);
        }
        return instance;
    }
1241443
public static Object getElValue(JspContext context, String elName) {
        VariableResolver variableResolver = context.getVariableResolver();
        Object var = null;
        try {
            elName = TagUtils.getElName(elName);
            var    = variableResolver.resolveVariable(elName);
            logger.debug("ExpressionLanguage variable {} is [{}]", elName, var);
        } catch (ELException e) {
            logger.error("ExpressionLanguage Error", e);
        }

        return var;
    }
695723
public B importContext(AbstractContext context){
        Objects.requireNonNull(context);
        return importContext(context, false);
    }
1178015
public static FacesBackingBeanFactory get( ServletContext servletContext )
    {
        FacesBackingBeanFactory factory = ( FacesBackingBeanFactory ) servletContext.getAttribute( CONTEXT_ATTR );
        assert factory != null
                : FacesBackingBeanFactory.class.getName() + " was not found in ServletContext attribute " + CONTEXT_ATTR;
        factory.reinit( servletContext );
        return factory;
    }
803531
public static ConstructorBuilder getInstance(Context context,
            ClassDoc classDoc, ConstructorWriter writer) {
        return new ConstructorBuilder(context, classDoc, writer);
    }
276228
public synchronized EvaluatorContext getContext(final String contextId) {
    for (final EvaluatorContext context : this.contextStack) {
      if (context.getId().equals(contextId)) {
        return context;
      }
    }
    throw new RuntimeException("Unknown evaluator context " + contextId);
  }
120873
public static JNIWriter instance(Context context) {
        JNIWriter instance = context.get(jniWriterKey);
        if (instance == null)
            instance = new JNIWriter(context);
        return instance;
    }
300585
public void setContext(Context context) {
        context.put(JavacElements.class, this);
        javaCompiler = JavaCompiler.instance(context);
        syms = Symtab.instance(context);
        names = Names.instance(context);
        types = Types.instance(context);
        enter = Enter.instance(context);
    }
10377
public JdbcMapperFactory getterFactory(final GetterFactory<ResultSet, JdbcColumnKey> getterFactory) {
		return addGetterFactory(new ContextualGetterFactoryAdapter<ResultSet, JdbcColumnKey>(getterFactory));
	}