ListStyle extends AbstractCssProperty<ListStyle> implements StateChangeInformer<CssProperty> { public static boolean isValid(final String cssValue) { if (cssValue == null || StringUtil.isBlank(cssValue)) { return false; } final String[] cssValueParts = StringUtil.splitBySpace(cssValue); ListStyleType listStyleType = null; ListStylePosition listStylePosition = null; ListStyleImage listStyleImage = null; for (final String eachPart : cssValueParts) { boolean invalid = true; if (listStyleType == null && ListStyleType.isValid(eachPart)) { listStyleType = ListStyleType.getThis(eachPart); invalid = false; } else if (listStylePosition == null && ListStylePosition.isValid(eachPart)) { listStylePosition = ListStylePosition.getThis(eachPart); invalid = false; } else if (listStyleImage == null && ListStyleImage.isValid(eachPart)) { listStyleImage = new ListStyleImage(eachPart); invalid = false; } if (invalid) { return false; } } return listStyleType != null || listStylePosition != null || listStyleImage != null; } ListStyle();  ListStyle(final String cssValue);  ListStyle(final ListStyle listStyle); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); @Override ListStyle setCssValue(final String cssValue); static boolean isValid(final String cssValue); void setAsInitial(); void setAsInherit(); ListStyleImage getListStyleImage(); ListStylePosition getListStylePosition(); ListStyleType getListStyleType(); ListStyle setListStyleType(final ListStyleType listStyleType); ListStyle setListStylePosition(
            final ListStylePosition listStylePosition); ListStyle setListStyleImage(final ListStyleImage listStyleImage); @Override void stateChanged(final CssProperty stateChangedObject); static final String INITIAL; static final String INHERIT; }
@Test public void testIsValid() { assertTrue(ListStyle.isValid("circle inside url(Test.png)")); assertTrue(ListStyle.isValid("circle")); assertTrue(ListStyle.isValid("inside url(Test.png)")); assertTrue(ListStyle.isValid("url(Test.png)")); assertTrue(ListStyle.isValid(ListStyleType.ARMENIAN.getCssValue() + " " + ListStylePosition.OUTSIDE.getCssValue() + " url(Test.png)")); assertTrue(ListStyle.isValid(ListStyleType.CJK_IDEOGRAPHIC.getCssValue() + " " + ListStylePosition.INITIAL.getCssValue() + " url(Test.png)")); assertFalse(ListStyle.isValid("cir cle inside url(Test.png)")); assertFalse(ListStyle.isValid("dircle inside url(Test.png)")); assertFalse(ListStyle.isValid("circle ins ide url(Test.png)")); assertFalse(ListStyle.isValid("circle insside url(Test.png)")); assertFalse(ListStyle.isValid("circle inside ur l(Test.png)")); assertFalse(ListStyle.isValid("circle inside urll(Test.png)")); }