public PropertyValue parsePropertyValue(CSSName cssName, int origin, String expr) {
_URI = cssName + " property value";
try {
reset(new StringReader(expr));
List values = expr(
cssName == CSSName.FONT_FAMILY ||
cssName == CSSName.FONT_SHORTHAND ||
cssName == CSSName.FS_PDF_FONT_ENCODING);
PropertyBuilder builder = CSSName.getPropertyBuilder(cssName);
List props;
try {
props = builder.buildDeclarations(cssName, values, origin, false);
} catch (CSSParseException e) {
e.setLine(getCurrentLine());
throw e;
}
if (props.size() != 1) {
throw new CSSParseException(
"Builder created " + props.size() + "properties, expected 1", getCurrentLine());
}
PropertyDeclaration decl = (PropertyDeclaration)props.get(0);
return (PropertyValue)decl.getValue();
} catch (IOException e) {
throw new RuntimeException(e.getMessage(), e);
} catch (CSSParseException e) {
error(e, "property value", false);
return null;
}
}