/** * {@inheritDoc} */ public CallParamRule get() { return new CallParamRule(this.paramIndex, this.stackIndex); }
/** * {@inheritDoc} */ public CallParamRule get() { return new CallParamRule(this.index); }
/** * {@inheritDoc} */ public CallParamRule get() { return new CallParamRule(this.index, this.attribute); }
/** * Add a "call parameter" rule for the specified parameters. * * @param pattern Element matching pattern * @param paramIndex Zero-relative parameter index to set * (from the body of this element) * @see CallParamRule */ public void addCallParam(String pattern, int paramIndex) { addRule(pattern, new CallParamRule(paramIndex)); }
/** * Add a "call parameter" rule. * This will either take a parameter from the stack * or from the current element body text. * * @param paramIndex The zero-relative parameter number * @param fromStack Should the call parameter be taken from the top of the stack? * @see CallParamRule */ public void addCallParam(String pattern, int paramIndex, boolean fromStack) { addRule(pattern, new CallParamRule(paramIndex, fromStack)); }
/** * Add a "call parameter" rule that sets a parameter from the stack. * This takes a parameter from the given position on the stack. * * @param paramIndex The zero-relative parameter number * @param stackIndex set the call parameter to the stackIndex'th object down the stack, * where 0 is the top of the stack, 1 the next element down and so on * @see CallMethodRule */ public void addCallParam(String pattern, int paramIndex, int stackIndex) { addRule(pattern, new CallParamRule(paramIndex, stackIndex)); }
/** * Add a "call parameter" rule for the specified parameters. * * @param pattern Element matching pattern * @param paramIndex Zero-relative parameter index to set * (from the specified attribute) * @param attributeName Attribute whose value is used as the * parameter value * @see CallParamRule */ public void addCallParam(String pattern, int paramIndex, String attributeName) { addRule(pattern, new CallParamRule(paramIndex, attributeName)); }
@Override public Object createObject(Attributes attributes) { // create callparamrule int paramIndex = Integer.parseInt(attributes.getValue("paramnumber")); String attributeName = attributes.getValue("attrname"); String fromStack = attributes.getValue("from-stack"); 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."); } } return callParamRule; } }
/** * Add a "call parameter" rule that sets a parameter from the stack. * This takes a parameter from the given position on the stack. * * @param paramIndex The zero-relative parameter number * @param stackIndex set the call parameter to the stackIndex'th object down the stack, * where 0 is the top of the stack, 1 the next element down and so on * @see CallMethodRule */ public void addCallParam(String pattern, int paramIndex, int stackIndex) { addRule(pattern, new CallParamRule(paramIndex, stackIndex)); }
/** * Add a "call parameter" rule for the specified parameters. * * @param pattern Element matching pattern * @param paramIndex Zero-relative parameter index to set * (from the body of this element) * @see CallParamRule */ public void addCallParam(String pattern, int paramIndex) { addRule(pattern, new CallParamRule(paramIndex)); }
/** * Add a "call parameter" rule. * This will either take a parameter from the stack * or from the current element body text. * * @param paramIndex The zero-relative parameter number * @param fromStack Should the call parameter be taken from the top of the stack? * @see CallParamRule */ public void addCallParam(String pattern, int paramIndex, boolean fromStack) { addRule(pattern, new CallParamRule(paramIndex, fromStack)); }
public Object createObject(Attributes attributes) { // create callparamrule int paramIndex = Integer.parseInt(attributes.getValue("paramnumber")); String attributeName = attributes.getValue("attrname"); String fromStack = attributes.getValue("from-stack"); 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."); } } return callParamRule; } }
/** * Add a "call parameter" rule for the specified parameters. * * @param pattern Element matching pattern * @param paramIndex Zero-relative parameter index to set * (from the specified attribute) * @param attributeName Attribute whose value is used as the * parameter value * @see CallParamRule */ public void addCallParam(String pattern, int paramIndex, String attributeName) { addRule(pattern, new CallParamRule(paramIndex, attributeName)); }