protected Renderer getDelegate()

in myfaces-html5-core/src/main/java/org/apache/myfaces/html5/renderkit/input/HtmlInputTextRenderer.java [90:119]


    protected Renderer getDelegate(FacesContext context, UIComponent component)
    {
        // first, set component's input type
        checkInputHtmlType(component);

        String type = ((HtmlInputText) component).getType();
        if (type == null || type.equals("")) // should never happen; default value should be set! use renderer of
        // default case anyway.
        {
            if (log.isLoggable(Level.FINE))
                log.warning("should never happen! type is empty!");
            return _textTypeRendererDelegate;
        }
        else if (type.equals(JsfProperties.INPUTTEXT_TYPE_TEXT) || type.equals(JsfProperties.INPUTTEXT_TYPE_SEARCH)
                || type.equals(JsfProperties.INPUTTEXT_TYPE_URL) || type.equals(JsfProperties.INPUTTEXT_TYPE_TEL))
        {
            return _textTypeRendererDelegate;
        }
        else if (type.equals(JsfProperties.INPUTTEXT_TYPE_TEXTAREA))
        {
            return _textareaTypeRendererDelegate;
        }
        else
        {
            throw new IllegalStateException("Input type of component " + DebugUtils.getPathToComponent(component) + " is not one of the expected types: \""
                    + JsfProperties.INPUTTEXT_TYPE_TEXT + "\", \"" + JsfProperties.INPUTTEXT_TYPE_SEARCH + "\", \""
                    + JsfProperties.INPUTTEXT_TYPE_URL + "\" ,\"" + JsfProperties.INPUTTEXT_TYPE_TEL + "\". Provided: \""
                    + type + "\".");
        }
    }