/** * <p> * Creates a new Arguments object by setting a new selection target. * </p> * * @param newSelectionTarget the new selection target * @return the new Arguments object * @since 2.0.9 */ public Arguments setSelectionTarget(final Object newSelectionTarget) { return new Arguments(this.templateEngine, this.templateProcessingParameters, this.templateResolution, this.templateRepository, this.document, getLocalVariables(), this.idCounts, newSelectionTarget, true, getExpressionEnhancingDialects()); }
/** * <p> * Creates a new Arguments object by adding some new local variables and setting a * selection target. * </p> * * @param newVariables the new variables * @return the new Arguments object * @since 2.0.9 */ public Arguments addLocalVariablesAndSelectionTarget(final Map<String,Object> newVariables, final Object selectionTarget) { return new Arguments(this.templateEngine, this.templateProcessingParameters, this.templateResolution, this.templateRepository, this.document, mergeNewLocalVariables(newVariables), this.idCounts, selectionTarget, true, getExpressionEnhancingDialects()); }
/** * <p> * Creates a new Arguments object by adding some new local variables * to the existing map (the rest of the attributes are copied verbatim). * </p> * * @param newVariables the new variables * @return the new Arguments object */ public Arguments addLocalVariables(final Map<String,Object> newVariables) { if (newVariables == null || newVariables.isEmpty()) { return this; } return new Arguments(this.templateEngine, this.templateProcessingParameters, this.templateResolution, this.templateRepository, this.document, mergeNewLocalVariables(newVariables), this.idCounts, getSelectionTarget(), hasSelectionTarget(), getExpressionEnhancingDialects()); }