private int getKeywordValue(final FoContext context,
final AbsoluteCompass direction, final FObj fobj) {
final FoValue foValue = this.convertValueToFoValue(value());
switch (foValue) {
case INHERIT: {
final FObj effectiveParent = fobj.effectiveParent(context);
if (direction == AbsoluteCompass.LEFT) {
return effectiveParent.getMarginLeft(context);
}
if (direction == AbsoluteCompass.RIGHT) {
return effectiveParent.getMarginRight(context);
}
if (direction == AbsoluteCompass.TOP) {
return effectiveParent.getMarginTop(context);
}
if (direction == AbsoluteCompass.BOTTOM) {
return effectiveParent.getMarginBottom(context);
}
}
}
throw this.unexpectedRetrieval();
}