Flex extends AbstractCssProperty<Flex> implements StateChangeInformer<CssProperty> { @Override public void stateChanged(final CssProperty stateChangedObject) { if (stateChangedObject instanceof FlexGrow) { final FlexGrow flexGrow = (FlexGrow) stateChangedObject; final String cssValue = flexGrow.getCssValue(); if (FlexGrow.INITIAL.equals(cssValue) || FlexGrow.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as flexGrow cssValue"); } final StringBuilder sb = new StringBuilder(flexGrow.getCssValue()); sb.append(' ').append(flexShrink.getCssValue()).append(' ') .append(flexBasis.getCssValue()); this.cssValue = sb.toString(); } else if (stateChangedObject instanceof FlexShrink) { final FlexShrink flexShrink = (FlexShrink) stateChangedObject; final String cssValue = flexShrink.getCssValue(); if (FlexShrink.INITIAL.equals(cssValue) || FlexShrink.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as flexShrink cssValue"); } final StringBuilder sb = new StringBuilder(flexGrow.getCssValue()); sb.append(' ').append(flexShrink.getCssValue()).append(' ') .append(flexBasis.getCssValue()); this.cssValue = sb.toString(); } else if (stateChangedObject instanceof FlexBasis) { final FlexBasis flexBasis = (FlexBasis) stateChangedObject; final String cssValue = flexBasis.getCssValue(); if (FlexBasis.INITIAL.equals(cssValue) || FlexBasis.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as flexBasis cssValue"); } this.cssValue = new StringBuilder(flexGrow.getCssValue()) .append(' ').append(flexShrink.getCssValue()).append(' ') .append(flexBasis.getCssValue()).toString(); } } Flex();  Flex(final String cssValue);  Flex(final Flex flex); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override Flex setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); FlexBasis getFlexBasis(); FlexShrink getFlexShrink(); FlexGrow getFlexGrow(); Flex setFlexGrow(final FlexGrow flexGrow); Flex setFlexShrink(final FlexShrink flexShrink); Flex setFlexBasis(final FlexBasis flexBasis); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; static final String AUTO; }
@Test public void testStateChanged() { }