public Object getAsObject()

in myfaces-html5-core/src/main/java/org/apache/myfaces/html5/renderkit/input/util/Html5EmailConverter.java [40:67]


    public Object getAsObject(FacesContext context, UIComponent component, String value) throws ConverterException
    {
        if (value == null)
            return null;

        if (value.length() == 0)
            return null;

        String[] emails = value.split(",");
        if (emails != null && emails.length > 0)
        {
            for (String email : emails)
            {
                email = email.trim();
                if (!EmailValidator.getInstance().isValid(email))
                {
                    throw new ConverterException(new FacesMessage("Provided value for component "
                            + DebugUtils.getPathToComponent(component) + " is not a valid email: " + email));
                }
            }

            return emails;
        }
        else
        {
            return null;
        }
    }