@Override public final UIComponent createComponent(final String componentType) throws FacesException { checkNull(componentType, "componentType"); checkEmpty(componentType, "componentType"); final Class<?> 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 = (UIComponent)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); } }
@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); } }
@Override public final UIComponent createComponent(final String componentType) throws FacesException { checkNull(componentType, "componentType"); checkEmpty(componentType, "componentType"); final Class<?> 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 = (UIComponent)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); } }
_handleAnnotations(facesContext, component, component); return component;
private void _inspectRenderer(FacesContext context, UIComponent component, String componentType, String rendererType) { /* * The Renderer instance to inspect must be obtained by calling FacesContext.getRenderKit() and calling * RenderKit.getRenderer(java.lang.String, java.lang.String) on the result, passing the argument componentFamily * of the newly created component as the first argument and the argument rendererType as the second argument. */ Renderer renderer = context.getRenderKit().getRenderer(component.getFamily(), rendererType); if (renderer == null) { // If no such Renderer can be found, a message must be logged with a helpful error message. log.severe("renderer cannot be found for component type " + componentType + " and renderer type " + rendererType); } else { // Otherwise, UIComponent.setRendererType(java.lang.String) must be called on the newly created // UIComponent instance, passing the argument rendererType as the argument. component.setRendererType(rendererType); /* * except the Renderer for the component to be returned must be inspected for the annotations mentioned in * createComponent(ValueExpression, FacesContext, String) as specified in the documentation for that method. */ _handleAnnotations(context, renderer, component); } }
private void _inspectRenderer(FacesContext context, UIComponent component, String componentType, String rendererType) { /* * The Renderer instance to inspect must be obtained by calling FacesContext.getRenderKit() and calling * RenderKit.getRenderer(java.lang.String, java.lang.String) on the result, passing the argument componentFamily * of the newly created component as the first argument and the argument rendererType as the second argument. */ Renderer renderer = context.getRenderKit().getRenderer(component.getFamily(), rendererType); if (renderer == null) { // If no such Renderer can be found, a message must be logged with a helpful error message. log.severe("renderer cannot be found for component type " + componentType + " and renderer type " + rendererType); } else { // Otherwise, UIComponent.setRendererType(java.lang.String) must be called on the newly created // UIComponent instance, passing the argument rendererType as the argument. component.setRendererType(rendererType); /* * except the Renderer for the component to be returned must be inspected for the annotations mentioned in * createComponent(ValueExpression, FacesContext, String) as specified in the documentation for that method. */ _handleAnnotations(context, renderer, component); } }
_handleAnnotations(context, component, component);
_handleAnnotations(context, component, component);
_handleAnnotations(context, component, component);
_handleAnnotations(facesContext, createdComponent, createdComponent);
_handleAnnotations(facesContext, createdComponent, createdComponent);
_handleAnnotations(facesContext, createdComponent, createdComponent);