Font extends AbstractCssProperty<Font> implements StateChangeInformer<CssProperty> { public static boolean isValid(final String cssValue) { if (cssValue == null || StringUtil.isBlank(cssValue)) { return false; } final String[] cssValueParts = getExtractedSubCssValues(cssValue); FontStyle fontStyle = null; FontVariant fontVariant = null; FontWeight fontWeight = null; FontSize fontSize = null; LineHeight lineHeight = null; FontFamily fontFamily = null; for (final String eachPart : cssValueParts) { boolean invalid = true; if (fontStyle == null && FontStyle.isValid(eachPart)) { fontStyle = FontStyle.getThis(eachPart); invalid = false; } else if (fontVariant == null && FontVariant.isValid(eachPart)) { fontVariant = FontVariant.getThis(eachPart); invalid = false; } else if (fontWeight == null && FontWeight.isValid(eachPart)) { fontWeight = FontWeight.getThis(eachPart); invalid = false; } else if (fontSize == null && FontSize.isValid(eachPart)) { fontSize = new FontSize(eachPart); invalid = false; } else if (lineHeight == null && LineHeight.isValid(eachPart)) { lineHeight = new LineHeight(eachPart); invalid = false; } else if (fontFamily == null && (!FontFamily.isValidateFontFamilyNameGlobally() || FontFamily.isValid(eachPart))) { fontFamily = new FontFamily(eachPart); invalid = false; } if (invalid) { return false; } } return fontStyle != null || fontVariant != null || fontWeight != null || fontSize != null || lineHeight != null || fontFamily != null; } Font();  Font(final String cssValue);  Font(final Font font); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override Font setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); void setAsCaption(); void setAsIcon(); void setAsMenu(); void setAsMessageBox(); void setAsSmallCaption(); void setAsStatusBar(); FontSize getFontSize(); LineHeight getLineHeight(); FontFamily getFontFamily(); FontVariant getFontVariant(); FontWeight getFontWeight(); FontStyle getFontStyle(); Font setFontStyle(final FontStyle fontStyle); Font setFontVariant(final FontVariant fontVariant); Font setFontWeight(final FontWeight fontWeight); Font setFontSize(final FontSize fontSize); Font setLineHeight(final LineHeight lineHeight); Font setFontFamily(final FontFamily fontFamily); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; static final String CAPTION; static final String ICON; static final String MENU; static final String MESSAGE_BOX; static final String SMALL_CAPTION; static final String STATUS_BAR; }
@Test public void testIsValid() { }