PerspectiveOrigin extends AbstractCssProperty<PerspectiveOrigin> { public static boolean isValid(final String cssValue) { final String trimmedCssValue = TagStringUtil .toLowerCase(StringUtil.strip(cssValue)); final String[] cssValueParts = StringUtil.splitBySpace(trimmedCssValue); if (cssValueParts.length > 2) { return false; } if (PREDEFINED_CONSTANTS.contains(trimmedCssValue)) { return true; } boolean valid = false; for (final String each : cssValueParts) { final Object[] lengthValueAndUnit = CssLengthUtil .getLengthValueAsPremitiveAndUnit(each); if (lengthValueAndUnit.length != 2) { return false; } valid = true; } return valid; } PerspectiveOrigin();  PerspectiveOrigin(final String cssValue);  PerspectiveOrigin(final PerspectiveOrigin backgroundSize);  PerspectiveOrigin(final float xyAxis,
            final CssLengthUnit cssLengthUnit);  PerspectiveOrigin(final float xAxis,
            final CssLengthUnit xAxisCssLengthUnit, final float yAxis,
            final CssLengthUnit yAxisCssLengthUnit); PerspectiveOrigin setValue(final float xAxis,
            final CssLengthUnit xAxisCssLengthUnit, final float yAxis,
            final CssLengthUnit yAxisCssLengthUnit); PerspectiveOrigin setValue(final float xyAxis,
            final CssLengthUnit cssLengthUnit); @Override String getCssName(); @Override String getCssValue(); @Override String toString(); Float getXAxis(); Float getYAxis(); CssLengthUnit getXAxisUnit(); CssLengthUnit getYAxisUnit(); @Override PerspectiveOrigin setCssValue(final String cssValue); void setAsInitial(); void setAsInherit(); static boolean isValid(final String cssValue); static final String INITIAL; static final String INHERIT; }
@Test public void testIsValid() { assertTrue(PerspectiveOrigin.isValid("55px")); assertTrue(PerspectiveOrigin.isValid("55px 85cm")); assertTrue(PerspectiveOrigin.isValid("55% 85cm")); assertTrue(PerspectiveOrigin.isValid("12% 12%")); assertFalse(PerspectiveOrigin.isValid("12")); assertFalse(PerspectiveOrigin.isValid("12 25")); assertFalse(PerspectiveOrigin.isValid("sdfdf")); }