BorderBottom extends AbstractCssProperty<BorderBottom> implements StateChangeInformer<CssProperty> { public BorderBottom setBorderBottomWidth( final BorderBottomWidth borderBottomWidth) { final StringBuilder cssValueBuilder = new StringBuilder(); if (borderBottomWidth != null) { final String borderBottomWidthCssValue = borderBottomWidth .getCssValue(); if (BorderBottomWidth.INITIAL.equals(borderBottomWidthCssValue) || BorderBottomWidth.INHERIT .equals(borderBottomWidthCssValue)) { throw new InvalidValueException( "borderBottomWidth cannot have initial/inherit as its cssValue"); } cssValueBuilder.append(borderBottomWidth.getCssValue()).append(' '); } if (borderBottomStyle != null) { cssValueBuilder.append(borderBottomStyle.getCssValue()).append(' '); } if (borderBottomColor != null) { cssValueBuilder.append(borderBottomColor.getCssValue()).append(' '); } final String trimmedCssValue = StringBuilderUtil .getTrimmedString(cssValueBuilder).toString(); cssValue = trimmedCssValue.isEmpty() ? INHERIT : trimmedCssValue; if (borderBottomWidth != null && borderBottomWidth.isAlreadyInUse() && !Objects.equals(this.borderBottomWidth, borderBottomWidth)) { if (LOGGER.isLoggable(Level.WARNING)) { LOGGER.warning( "the given borderBottomWidth is already used by another object so a new object or the previous object (if it exists) of BorderBottomWidth will be used"); } return setCssValue(cssValue); } if (this.borderBottomWidth != null) { this.borderBottomWidth.setAlreadyInUse(false); } this.borderBottomWidth = borderBottomWidth; if (this.borderBottomWidth != null) { this.borderBottomWidth.setStateChangeInformer(this); this.borderBottomWidth.setAlreadyInUse(true); } if (getStateChangeInformer() != null) { getStateChangeInformer().stateChanged(this); } return this; } BorderBottom();  BorderBottom(final String cssValue);  BorderBottom(final BorderBottom borderBottom); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override BorderBottom setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); BorderBottomColor getBorderBottomColor(); BorderBottomStyle getBorderBottomStyle(); BorderBottomWidth getBorderBottomWidth(); BorderBottom setBorderBottomWidth(
            final BorderBottomWidth borderBottomWidth); BorderBottom setBorderBottomStyle(
            final BorderBottomStyle borderBottomStyle); BorderBottom setBorderBottomColor(
            final BorderBottomColor borderBottomColor); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; }
@Test public void testSetBorderBottomWidth() { BorderBottom border = new BorderBottom(); border.setCssValue("thick solid green"); assertEquals("thick solid green", border.getCssValue()); final BorderBottomWidth borderBottomWidth = border.getBorderBottomWidth(); assertTrue(borderBottomWidth.isAlreadyInUse()); assertEquals("thick", borderBottomWidth.getCssValue()); border.setBorderBottomWidth(new BorderBottomWidth()); border.setCssValue("solid green"); assertNull(border.getBorderBottomWidth()); assertFalse(borderBottomWidth.isAlreadyInUse()); assertEquals("solid green", border.getCssValue()); }
@Test(expected = InvalidValueException.class) public void testSetBorderBottomWidthInvalidValue() { BorderBottom border = new BorderBottom(); border.setBorderBottomWidth(new BorderBottomWidth("initial")); }