FlexShrink extends AbstractCssProperty<FlexShrink> { public static boolean isValid(final String cssValue) { final String trimmedCssValue = TagStringUtil .toLowerCase(StringUtil.strip(cssValue)); if (StringUtil.containsSpace(trimmedCssValue)) { return false; } try { Float.parseFloat(trimmedCssValue); return true; } catch (final NumberFormatException e) { } return PREDEFINED_CONSTANTS.contains(trimmedCssValue); } FlexShrink();  FlexShrink(final String cssValue);  FlexShrink(final FlexShrink flexShrink);  FlexShrink(final float value); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); Float getValue(); void setValue(final float value); @Override FlexShrink setCssValue(final String cssValue); void setAsInitial(); void setAsInherit(); static boolean isValid(final String cssValue); static final String INITIAL; static final String INHERIT; }
@Test public void testIsValid() { assertTrue(FlexShrink.isValid(".5")); assertTrue(FlexShrink.isValid("0.5")); assertTrue(FlexShrink.isValid("0.1")); assertTrue(FlexShrink.isValid("1")); assertTrue(FlexShrink.isValid("0")); assertTrue(FlexShrink.isValid(FlexShrink.INITIAL)); assertTrue(FlexShrink.isValid(FlexShrink.INHERIT)); assertFalse(FlexShrink.isValid("dfd")); assertFalse(FlexShrink.isValid("1px")); assertFalse(FlexShrink.isValid("")); assertFalse(FlexShrink.isValid("1 1")); assertTrue(FlexShrink.isValid("1.1")); }