final InputSource source = new InputSource();
source.setCharacterStream(new StringReader(value));
handler.initParseContext(source);
handler.setStyleRule(new CSSStyleRule(null, null));
parser.setDocumentHandler(handler);
final LexicalUnit lu = parser.parsePropertyValue(source);
handler.property(key.getName(), lu, false);
final CSSStyleRule rule = (CSSStyleRule) handler.getStyleRule();
CSSParserContext.getContext().destroy();
return rule.getPropertyCSSValue(key);
}
}
catch (Exception e)
{
e.printStackTrace();