private void createAndLogNewApplication() { _application = new ApplicationImpl(); if (log.isTraceEnabled()) log.trace("New ApplicationFactory instance created"); }
/** * @deprecated Use createComponent(ValueExpression, FacesContext, String) instead. */ @Deprecated @Override public UIComponent createComponent(ValueBinding valueBinding, FacesContext facesContext, String componentType) throws FacesException { checkNull(valueBinding, "valueBinding"); checkNull(facesContext, "facesContext"); checkNull(componentType, "componentType"); checkEmpty(componentType, "componentType"); ValueExpression valExpression = new ValueBindingToValueExpression(valueBinding); return createComponent(valExpression, facesContext, componentType); }
@Override public final ELResolver getELResolver() { // we don't need synchronization here since it is ok to have multiple // instances of the elresolver if (elResolver == null) { elResolver = createFacesResolver(); } return elResolver; }
@Override public UIComponent createComponent(ValueExpression componentExpression, FacesContext context, String componentType, String rendererType) { // Like createComponent(ValueExpression, FacesContext, String) UIComponent component = createComponent(componentExpression, context, componentType); _inspectRenderer(context, component, componentType, rendererType); return component; }
@Override public Converter createConverter(Class targetClass) { checkNull(targetClass, "targetClass"); return internalCreateConverter(targetClass); }
@Override public UIComponent createComponent(FacesContext context, String componentType, String rendererType) { checkNull(context, "context"); checkNull(componentType, "componentType"); // Like createComponent(String) UIComponent component = createComponent(componentType); _inspectRenderer(context, component, componentType, rendererType); return component; }
/** * @deprecated */ @Override public final ValueBinding createValueBinding(final String reference) throws ReferenceSyntaxException { checkNull(reference, "reference"); checkEmpty(reference, "reference"); ValueExpression valueExpression; try { valueExpression = getExpressionFactory().createValueExpression(threadELContext(), reference, Object.class); } catch (ELException e) { throw new ReferenceSyntaxException(e); } return new ValueExpressionToValueBinding(valueExpression); }
@Override public java.util.ResourceBundle getResourceBundle(FacesContext facesContext, String name) throws FacesException, NullPointerException { checkNull(facesContext, "facesContext"); checkNull(name, "name"); String bundleName = getBundleName(facesContext, name); if (bundleName == null) { return null; } Locale locale = Locale.getDefault(); UIViewRoot viewRoot = facesContext.getViewRoot(); if (viewRoot != null && viewRoot.getLocale() != null) { locale = viewRoot.getLocale(); } try { return getResourceBundle(bundleName, locale, getClassLoader()); } catch (MissingResourceException e) { throw new FacesException("Could not load resource bundle for name '" + name + "': " + e.getMessage(), e); } }
@Override public void addBehavior(String behaviorId, String behaviorClass) { checkNull(behaviorId, "behaviorId"); checkEmpty(behaviorId, "behaviorId"); checkNull(behaviorClass, "behaviorClass"); checkEmpty(behaviorClass, "behaviorClass"); try { if(isLazyLoadConfigObjects()) _behaviorClassMap.put(behaviorId, behaviorClass); else _behaviorClassMap.put(behaviorId, ClassUtils.simpleClassForName(behaviorClass)); if (log.isLoggable(Level.FINEST)) log.finest("add Behavior class = " + behaviorClass + " for id = " + behaviorId); } catch (Exception e) { log.log(Level.SEVERE, "Behavior class " + behaviorClass + " not found", e); } }
public void addConverterConfiguration(String converterClassName, org.apache.myfaces.config.impl.digester.elements.Converter configuration) { checkNull(converterClassName, "converterClassName"); checkEmpty(converterClassName, "converterClassName"); checkNull(configuration, "configuration"); _converterClassNameToConfigurationMap.put(converterClassName, configuration); }
@Override public final UIComponent createComponent(final String componentType) throws FacesException { checkNull(componentType, "componentType"); checkEmpty(componentType, "componentType"); final Class<? extends UIComponent> componentClass = getObjectFromClassMap(componentType, _componentClassMap); if (componentClass == null) { log.log(Level.SEVERE, "Undefined component type " + componentType); throw new FacesException("Undefined component type " + componentType); } try { UIComponent component = componentClass.newInstance(); _handleAnnotations(FacesContext.getCurrentInstance(), component, component); return component; } catch (Exception e) { log.log(Level.SEVERE, "Could not instantiate component componentType = " + componentType, e); throw new FacesException("Could not instantiate component componentType = " + componentType, e); } }
checkNull(componentExpression, "componentExpression"); checkNull(facesContext, "facesContext"); checkNull(componentType, "componentType"); _handleAnnotations(facesContext, createdComponent, createdComponent); createdComponent = createComponent(componentType); componentExpression.setValue(elContext, createdComponent);
/** * @deprecated */ @Deprecated @Override public void setPropertyResolver(PropertyResolver propertyResolver) { checkNull(propertyResolver, "propertyResolver"); if (getFaceContext() != null) { throw new IllegalStateException("propertyResolver must be defined before request processing"); } _runtimeConfig.setPropertyResolver(propertyResolver); if (log.isTraceEnabled()) log.trace("set PropertyResolver = " + propertyResolver.getClass().getName()); }
@Override public final void setFlowHandler(FlowHandler flowHandler) { checkNull(flowHandler, "flowHandler"); if(isFirstRequestProcessed()) { throw new IllegalStateException( "setFlowHandler may not be executed after a lifecycle request has been completed"); } _flowHandler = flowHandler; }
@Override public Converter createConverter(String converterId) { checkNull(converterId, "converterId"); checkEmpty(converterId, "converterId"); Class converterClass = _converterIdToClassMap.get(converterId); if(converterClass == null) { throw new FacesException("Could not find any registered converter-class by converterId : "+converterId); } try { Converter converter = (Converter) converterClass.newInstance(); setConverterProperties(converterClass, converter); return converter; } catch (Exception e) { log.error("Could not instantiate converter " + converterClass, e); throw new FacesException("Could not instantiate converter: " + converterClass, e); } }
@Override public final void setMessageBundle(final String messageBundle) { checkNull(messageBundle, "messageBundle"); _messageBundle = messageBundle; if (log.isLoggable(Level.FINEST)) { log.finest("set MessageBundle = " + messageBundle); } }
private boolean isLazyLoadConfigObjects() { if (_lazyLoadConfigObjects == null) { String configParam = getFaceContext().getExternalContext().getInitParameter(LAZY_LOAD_CONFIG_OBJECTS_PARAM_NAME); _lazyLoadConfigObjects = configParam == null ? LAZY_LOAD_CONFIG_OBJECTS_DEFAULT_VALUE : Boolean.parseBoolean(configParam); } return _lazyLoadConfigObjects; }
UIOutput output = (UIOutput) createComponent(UIOutput.COMPONENT_TYPE); if (name != null && name.length() > 0) name = ELText.parse(getExpressionFactory(), context.getELContext(), name).toString(context.getELContext()); if (library != null && library.length() > 0) library = ELText.parse(getExpressionFactory(), context.getELContext(), library).toString(context.getELContext()); if (target != null && target.length() > 0) target = ELText.parse(getExpressionFactory(), context.getELContext(), target).toString(context.getELContext());
checkNull(componentExpression, "componentExpression"); checkNull(facesContext, "facesContext"); checkNull(componentType, "componentType"); createdComponent = createComponent(componentType); componentExpression.setValue(elContext, createdComponent);
UIOutput output = (UIOutput) createComponent(context, UIOutput.COMPONENT_TYPE, null); if (name != null && name.length() > 0) name = ELText.parse(getExpressionFactory(), context.getELContext(), name).toString(context.getELContext()); setResourceIdOnFaceletsMode(context, output, inspectedClass); if (library != null && library.length() > 0) library = ELText.parse(getExpressionFactory(), context.getELContext(), library).toString(context.getELContext()); if (target != null && target.length() > 0) target = ELText.parse(getExpressionFactory(), context.getELContext(), target).toString(context.getELContext());