@Test public void toBoolean_valueIsTrue() throws JspException { assertThat(JspTagUtils.toBoolean("true", false, null), is(true)); assertThat(JspTagUtils.toBoolean("TRUE", false, null), is(true)); assertThat(JspTagUtils.toBoolean("TrUe", false, null), is(true)); }
public static boolean toBoolean(String attributeValue, boolean defaultValue, String attributeName) throws JspTagException { if (StringUtils.hasText(attributeValue)) { if ("true".equalsIgnoreCase(attributeValue) || "false" .equalsIgnoreCase(attributeValue)) { return Boolean.parseBoolean(attributeValue); } else { throw new JspTagException("The value of " + attributeName + " must be either true or false."); } } return defaultValue; }
JspTagUtils { public static boolean toBoolean(String attributeValue, boolean defaultValue, String attributeName) throws JspTagException { if (StringUtils.hasText(attributeValue)) { if ("true".equalsIgnoreCase(attributeValue) || "false" .equalsIgnoreCase(attributeValue)) { return Boolean.parseBoolean(attributeValue); } else { throw new JspTagException("The value of " + attributeName + " must be either true or false."); } } return defaultValue; } }
JspTagUtils { public static boolean toBoolean(String attributeValue, boolean defaultValue, String attributeName) throws JspTagException { if (StringUtils.hasText(attributeValue)) { if ("true".equalsIgnoreCase(attributeValue) || "false" .equalsIgnoreCase(attributeValue)) { return Boolean.parseBoolean(attributeValue); } else { throw new JspTagException("The value of " + attributeName + " must be either true or false."); } } return defaultValue; } private  JspTagUtils(); }
JspTagUtils { public static boolean toBoolean(String attributeValue, boolean defaultValue, String attributeName) throws JspTagException { if (StringUtils.hasText(attributeValue)) { if ("true".equalsIgnoreCase(attributeValue) || "false" .equalsIgnoreCase(attributeValue)) { return Boolean.parseBoolean(attributeValue); } else { throw new JspTagException("The value of " + attributeName + " must be either true or false."); } } return defaultValue; } private  JspTagUtils(); static boolean toBoolean(String attributeValue, boolean defaultValue,
            String attributeName); }
JspTagUtils { public static boolean toBoolean(String attributeValue, boolean defaultValue, String attributeName) throws JspTagException { if (StringUtils.hasText(attributeValue)) { if ("true".equalsIgnoreCase(attributeValue) || "false" .equalsIgnoreCase(attributeValue)) { return Boolean.parseBoolean(attributeValue); } else { throw new JspTagException("The value of " + attributeName + " must be either true or false."); } } return defaultValue; } private  JspTagUtils(); static boolean toBoolean(String attributeValue, boolean defaultValue,
            String attributeName);  }