String stackIndex = attributes.getValue("stack-index");
Rule callParamRule = null;
if (attributeName == null) {
if (stackIndex != null) {
callParamRule = new CallParamRule(
paramIndex, Integer.parseInt(stackIndex));
} else if (fromStack != null) {
callParamRule = new CallParamRule(
paramIndex, Boolean.valueOf(fromStack).booleanValue());
} else {
callParamRule = new CallParamRule(paramIndex);
}
} else {
if (fromStack == null) {
callParamRule = new CallParamRule(paramIndex, attributeName);
} else {
// specifying both from-stack and attribute name is not allowed
throw new RuntimeException(
"Attributes from-stack and attrname cannot both be present.");
}