WebkitFlex extends AbstractCssProperty<WebkitFlex> implements StateChangeInformer<CssProperty> { public static boolean isValid(final String cssValue) { if (cssValue == null || StringUtil.isBlank(cssValue)) { return false; } final String[] cssValueParts = StringUtil.splitBySpace(cssValue); WebkitFlexGrow webkitFlexGrow = null; WebkitFlexShrink webkitFlexShrink = null; WebkitFlexBasis webkitFlexBasis = null; for (final String eachPart : cssValueParts) { boolean invalid = true; if (webkitFlexGrow == null && WebkitFlexGrow.isValid(eachPart)) { webkitFlexGrow = new WebkitFlexGrow(eachPart); invalid = false; } else if (webkitFlexShrink == null && WebkitFlexShrink.isValid(eachPart)) { webkitFlexShrink = new WebkitFlexShrink(eachPart); invalid = false; } else if (webkitFlexBasis == null && WebkitFlexBasis.isValid(eachPart)) { webkitFlexBasis = new WebkitFlexBasis(eachPart); invalid = false; } if (invalid) { return false; } } return webkitFlexGrow != null || webkitFlexShrink != null || webkitFlexBasis != null; } WebkitFlex();  WebkitFlex(final String cssValue);  WebkitFlex(final WebkitFlex webkitFlex); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override WebkitFlex setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); WebkitFlexBasis getWebkitFlexBasis(); WebkitFlexShrink getWebkitFlexShrink(); WebkitFlexGrow getWebkitFlexGrow(); WebkitFlex setWebkitFlexGrow(final WebkitFlexGrow webkitFlexGrow); WebkitFlex setWebkitFlexShrink(
            final WebkitFlexShrink webkitFlexShrink); WebkitFlex setWebkitFlexBasis(
            final WebkitFlexBasis webkitFlexBasis); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; static final String AUTO; }
@Test public void testIsValid() { assertTrue(WebkitFlex.isValid("1")); assertTrue(WebkitFlex.isValid("1px")); assertTrue(WebkitFlex.isValid("1 1")); assertTrue(WebkitFlex.isValid("1 2 3px")); assertFalse(WebkitFlex.isValid("1 2 3")); assertFalse(WebkitFlex.isValid("1 df")); assertFalse(WebkitFlex.isValid("kdfidk")); assertFalse(WebkitFlex.isValid("1 2 2 2")); }