*/
private PdBorderSeparation createPropertyValue(final FObj fobj,
final String value) throws PropertyException {
/* BorderSpacing is a shorthand for BorderSeparation, so we will create
* and wrap an actual BorderSeparation instance. */
final PropertyValue pv = this.standardParse(fobj, value);
if (pv.canEvalKeyword()) {
return new PdBorderSeparation(pv);
}
if (pv.canEvalLength()) {
/* There is only one length. */
final DtLengthBPIPDirection bpip = new DtLengthBPIPDirection(pv,
pv);
return new PdBorderSeparation(bpip);
}
/* The only other valid option is that there are two lengths. */
final StringTokenizer st = new StringTokenizer(value);
if (st.countTokens() != 2) {
throw unexpectedValue(value, fobj);
}
final PropertyValue token1 = standardParse(fobj, st.nextToken());
final PropertyValue token2 = standardParse(fobj, st.nextToken());
if (token1.canEvalLength()
&& token2.canEvalLength()) {
final DtLengthBPIPDirection bpip = new DtLengthBPIPDirection(token1,
token2);
return new PdBorderSeparation(bpip);
}
throw unexpectedValue(value, fobj);