protected void checkInputHtmlType()

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


    protected void checkInputHtmlType(UIComponent uiComponent)
    {
        // XXX: this is called from too many places! reduce them!
        HtmlInputText component = (HtmlInputText) uiComponent;
        String type = component.getType();
        if (log.isLoggable(Level.FINE))
            log.fine("type is :" + type);

        if (type == null || type.length() == 0)
        {
            // set type to textarea, if no type is set and rows are set
            if (component.getRows() > HtmlInputText.ROWS_DEFAULT_VALUE)
            {
                if (log.isLoggable(Level.FINE))
                    log.fine("type set to textarea since type is not set, and rows attr is set");
                component.setType(JsfProperties.INPUTTEXT_TYPE_TEXTAREA);
            }
            else
                component.setType(JsfProperties.INPUTTEXT_TYPE_TEXT);

        }
        else
        {
            if (!(Arrays.asList(ALLOWED_INPUT_TYPES).contains(type)))
                throw new FacesException("\"type\" attribute of component " + DebugUtils.getPathToComponent(uiComponent) + " can be one of " + Arrays.toString(ALLOWED_INPUT_TYPES)
                        + ". You provided: \"" + type + "\"");
        }
    }