CssUtils { public Map<String, String> parseBoxValues(final java.lang.String box, final java.lang.String pre, final java.lang.String post) { return parseBoxValues(box, pre, post, null); } private  CssUtils(); static CssUtils getInstance(); Map<String, String> parseBoxValues(final java.lang.String box,
                                             final java.lang.String pre, final java.lang.String post); Map<String, String> parseBoxValues(final String box,
                                              final String pre, final String post, String preKey); Map<String, String> parseBorder(final String border); Map<String, String> parseBorder(final String border, final String borderKey); String stripDoubleSpacesAndTrim(final String str); String stripDoubleSpacesTrimAndToLowerCase(final String str); Map<String, String> processBackground(final String background); Map<String, String> processListStyle(final String listStyle); Map<String, String> processFont(final String font); float checkMetricStyle(final Tag t, final String style); Float checkMetricStyle(final Map<String,String> css, final String style); boolean isMetricValue(final String value); boolean isRelativeValue(final String value); boolean isNumericValue(final String value); float parseValueToPt(final String value, final float baseValue); float parseRelativeValue(final String relativeValue, final float baseValue); float parsePxInCmMmPcToPt(final String length, final String defaultMetric); float parsePxInCmMmPcToPt(final String length); int determinePositionBetweenValueAndUnit(final String string); float getLeftAndRightMargin(final Tag t, final float pageWidth); String extractUrl(final String url); float validateTextHeight(final Map<String, String> css,
			float textHeight); float calculateMarginTop(final String value, final float largestFont, final MarginMemory configuration); float calculateMarginTop(final float value, final MarginMemory configuration); String trimAndRemoveQuoutes(String s); String[] splitComplexCssStyle(String s); static final int DEFAULT_FONT_SIZE_PT; }
@Test public void parse1BoxValuesTest() { String box = "2px"; Map<String, String> values = css.parseBoxValues(box, "pre-", "-post"); validateKeys(values); Assert.assertEquals(box, values.get("pre-right-post")); Assert.assertEquals(box, values.get("pre-left-post")); Assert.assertEquals(box, values.get("pre-bottom-post")); Assert.assertEquals(box, values.get("pre-top-post")); }
@Test public void parse2BoxValuesTest() { String box = "2px 5px"; Map<String, String> values = css.parseBoxValues(box, "pre-", "-post"); validateKeys(values); Assert.assertEquals("5px", values.get("pre-right-post")); Assert.assertEquals("5px", values.get("pre-left-post")); Assert.assertEquals("2px", values.get("pre-bottom-post")); Assert.assertEquals("2px", values.get("pre-top-post")); }
@Test public void parse3BoxValuesTest() { String box = "2px 3px 4px"; Map<String, String> values = css.parseBoxValues(box, "pre-", "-post"); validateKeys(values); Assert.assertEquals("3px", values.get("pre-right-post")); Assert.assertEquals("3px", values.get("pre-left-post")); Assert.assertEquals("4px", values.get("pre-bottom-post")); Assert.assertEquals("2px", values.get("pre-top-post")); }
@Test public void parse4BoxValuesTest() { String box = "2px 3px 4px 5px"; Map<String, String> values = css.parseBoxValues(box, "pre-", "-post"); validateKeys(values); Assert.assertEquals("3px", values.get("pre-right-post")); Assert.assertEquals("5px", values.get("pre-left-post")); Assert.assertEquals("4px", values.get("pre-bottom-post")); Assert.assertEquals("2px", values.get("pre-top-post")); }