MozFlex extends AbstractCssProperty<MozFlex> implements StateChangeInformer<CssProperty> { @Override public void stateChanged(final CssProperty stateChangedObject) { if (stateChangedObject instanceof MozFlexGrow) { final MozFlexGrow mozFlexGrow = (MozFlexGrow) stateChangedObject; final String cssValue = mozFlexGrow.getCssValue(); if (MozFlexGrow.INITIAL.equals(cssValue) || MozFlexGrow.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as mozFlexGrow cssValue"); } this.cssValue = new StringBuilder(mozFlexGrow.getCssValue()) .append(' ').append(mozFlexShrink.getCssValue()).append(' ') .append(mozFlexBasis.getCssValue()).toString(); } else if (stateChangedObject instanceof MozFlexShrink) { final MozFlexShrink mozFlexShrink = (MozFlexShrink) stateChangedObject; final String cssValue = mozFlexShrink.getCssValue(); if (MozFlexShrink.INITIAL.equals(cssValue) || MozFlexShrink.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as mozFlexShrink cssValue"); } this.cssValue = new StringBuilder(mozFlexGrow.getCssValue()) .append(' ').append(mozFlexShrink.getCssValue()).append(' ') .append(mozFlexBasis.getCssValue()).toString(); } else if (stateChangedObject instanceof MozFlexBasis) { final MozFlexBasis mozFlexBasis = (MozFlexBasis) stateChangedObject; final String cssValue = mozFlexBasis.getCssValue(); if (MozFlexBasis.INITIAL.equals(cssValue) || MozFlexBasis.INHERIT.equals(cssValue)) { throw new InvalidValueException( "initial/inherit cannot be set as mozFlexBasis cssValue"); } this.cssValue = new StringBuilder(mozFlexGrow.getCssValue()) .append(' ').append(mozFlexShrink.getCssValue()).append(' ') .append(mozFlexBasis.getCssValue()).toString(); } } MozFlex();  MozFlex(final String cssValue);  MozFlex(final MozFlex mozFlex); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override MozFlex setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsAuto(); MozFlexBasis getMozFlexBasis(); MozFlexShrink getMozFlexShrink(); MozFlexGrow getMozFlexGrow(); MozFlex setMozFlexGrow(final MozFlexGrow mozFlexGrow); MozFlex setMozFlexShrink(final MozFlexShrink mozFlexShrink); MozFlex setMozFlexBasis(final MozFlexBasis mozFlexBasis); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; static final String AUTO; }
@Test public void testStateChanged() { }