WebkitColumnCount extends AbstractCssProperty<WebkitColumnCount> { public static boolean isValid(final String cssValue) { final String trimmedCssValue = TagStringUtil .toLowerCase(StringUtil.strip(cssValue)); if (StringUtil.containsSpace(trimmedCssValue)) { return false; } try { final int parsedValue = Integer.parseInt(trimmedCssValue); return (parsedValue == 0 && (StringUtil.containsMinus(trimmedCssValue) || StringUtil.containsPlus(trimmedCssValue))) ? false : true; } catch (final NumberFormatException e) { } return PREDEFINED_CONSTANTS.contains(trimmedCssValue); } WebkitColumnCount();  WebkitColumnCount(final String cssValue);  WebkitColumnCount(final WebkitColumnCount webkitColumnCount);  WebkitColumnCount(final int value); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); Integer getValue(); void setValue(final int value); @Override WebkitColumnCount setCssValue(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); static boolean isValid(final String cssValue); static final String INITIAL; static final String INHERIT; static final String AUTO; }
@Test public void testIsValid() { assertTrue(WebkitColumnCount.isValid("1")); assertTrue(WebkitColumnCount.isValid("0")); assertTrue(WebkitColumnCount.isValid(WebkitColumnCount.INITIAL)); assertTrue(WebkitColumnCount.isValid(WebkitColumnCount.INHERIT)); assertTrue(WebkitColumnCount.isValid(WebkitColumnCount.AUTO)); assertFalse(WebkitColumnCount.isValid(".5")); assertFalse(WebkitColumnCount.isValid("0.5")); assertFalse(WebkitColumnCount.isValid("0.1")); assertFalse(WebkitColumnCount.isValid("dfd")); assertFalse(WebkitColumnCount.isValid("1px")); assertFalse(WebkitColumnCount.isValid("")); assertFalse(WebkitColumnCount.isValid("1 1")); assertFalse(WebkitColumnCount.isValid("1.1")); assertFalse(WebkitColumnCount.isValid("-0.5")); assertFalse(WebkitColumnCount.isValid("-0")); assertFalse(WebkitColumnCount.isValid("-0.0")); assertFalse(WebkitColumnCount.isValid("+0.0")); }