/*
Define a custom template parameter and value, this method can be called multiple times to add multiple parameters.

name - The name of the template parameter.
value - The value of the template parameter.
966503
public function AddTemplateParameter($name, $value)
	{
		$this->templateVariables = $this->appendParameter($this->templateVariables, $name, $value);
	}
350779
function (name, newValue) {
		if (arguments.length > 1) {
			this.setValue(name, newValue);
		}
		else {
			var attrs = name;
			this.setMap(attrs);
		}
	}
987660
def name(self, value):
        

        if isinstance(value, string_types):

            match = Parameter._PARAM_NAME_COMPILER_MATCHER(value)

            if match is None or match.group() != value:
                value = re_compile(value)

        self._name = value
848971
public function addPlaceholder($name, $value = null, $recursive = false)
    {
        list($name, , $template) = $this->getParentPlaceholder($name);
        if (!isset($template)) {
            $template = $this;
        }
        if ($template === false) {
            if ($this->throwException) {
                throw new TemplateException("Unknown scope: {$name}");
            }
            return;
        }
        $template->placeholders[$name] =
            isset($template->placeholders[$name]) && is_array($template->placeholders[$name])
                ? $this->_merge($template->placeholders[$name], (array)$value, $recursive)
                : $value;
    }
343720
public void setParameter(String name, String value) {
		// Global Fix by alexvinn for Issue 1010 : Unable to set flag parameter to parameterable header
		if(name == null) {
			throw new NullPointerException("parameter name is null ! ");
		}
		if(value == null) {
			removeParameter(name);
			return;
		}
		if(isModifiable == ModifiableRule.NotModifiable) {
			throw new IllegalStateException("it is forbidden to modify the parameters");
		}
		if(name.equalsIgnoreCase("tag") && (isModifiable == ModifiableRule.From || isModifiable == ModifiableRule.To)) {
			throw new IllegalStateException("it is forbidden to set the tag parameter on To or From Header");
		}
		if(name.equalsIgnoreCase("branch") && isModifiable == ModifiableRule.Via) {
			throw new IllegalStateException("it is forbidden to set the branch parameter on the Via Header");
		}
		//Fix from abondar for Issue 494 and angelo.marletta for Issue 502
		this.parameters.put(name.toLowerCase(), value);
		if(header != null) {
			try {
				if (isQuotableParam(name) && (header instanceof ParametersExt)){
					((ParametersExt) header).setQuotedParameter(name, value);
				}else{
					header.setParameter(name, "".equals(value) ? null : value);
				}
			} catch (ParseException e) {
				throw new IllegalArgumentException("Problem setting parameter",e);
			}
		}
	}
642378
private void appendParamValue(StringBuilder param, StringBuilder result) {
        if (param == null)
            throw UncheckedTemplateException.invalidArgumentName(param);

        // Object name is the parameter that should be found in the map.
        // If it's followed by points, the points remain in the "param" buffer.
        final String objectName  = takeUntilDotOrEnd(param);
        final Object objectValue = arguments.get(objectName);

        Object toAppend;
        if (param.length() != 0) {
            // If this is a chain object.method1.method2.method3
            // we recurse
            toAppend = valueInChain(objectValue, param);
        } else {
            // We evaluate if the obejct is an array
            // If it's an array we print it nicely
            toAppend = evaluateIfArray(objectValue);
        }
        if (null != toAppend) {
            result.append(toAppend);
        }

    }
956828
public B camundaInputParameter(String name, String value) {
    CamundaInputOutput camundaInputOutput = getCreateSingleExtensionElement(CamundaInputOutput.class);

    CamundaInputParameter camundaInputParameter = createChild(camundaInputOutput, CamundaInputParameter.class);
    camundaInputParameter.setCamundaName(name);
    camundaInputParameter.setTextContent(value);

    return myself;
  }
1202707
public function addConst($name, $value = null, $recursive = false, $changeable = false)
    {
        if ($this->existsConst($name) && !$changeable) {
            if (is_array($name)) {
                $name = implode('.', $name);
            }
            throw new TemplateException("Constant is defined: {$name}");
        }
        static::$constants[$name] =
            isset(static::$constants[$name]) && is_array(static::$constants[$name])
                ? $this->_merge(static::$constants[$name], (array)$value, $recursive)
                : $value;
    }
677245
function( name, value ) {
					if ( completed == null ) {
						name = requestHeadersNames[ name.toLowerCase() ] =
							requestHeadersNames[ name.toLowerCase() ] || name;
						requestHeaders[ name ] = value;
					}
					return this;
				}
1171383
public void addHeader(String name, String value) {
        if (name == null || name.trim().length() == 0) {
            throw new IllegalArgumentException("The header name must not be null or empty.");
        }

        if (value == null) {
            throw new IllegalArgumentException("The header value must not be null.");
        }

        this.headers.put(name, value);
    }
957374
public final void setParameter(String name, Object value) {
        if (isNative()) {
            bindParameters.add(new BindParameter(name, value));
        } else {
            setParameterValue(":" + name, value);
        }

        parametersMap.put(":" + name, value);
    }
676042
public function add($name, $value = null)
    {
        $name = trim($name);

        if (!isset($this->parameters[$name])) {
            $this->parameters[$name] = [];
        } elseif (!is_array($this->parameters[$name])) {
            $this->parameters[$name] = (array) $this->parameters[$name];
        }

        $this->parameters[$name][] = $value;
    }
772273
function(context, descriptor, args) {
		var path = args[0],
			values = (typeof path === 'string') ? context.get(path) : path;
		if (values && values.length) {
			var template = args[1];
			for (var i = 0, len = values.length; i < len; ++i)
				template.toHTMLString(new Context(values[i], context), descriptor);
		} else if (args[2])
			args[2].toHTMLString(context, descriptor);
	}
356874
public Request setParam(String name, Iterable<String> values) {
        this.params.putAll(name, values);
        return this;
    }
81396
public void addParamHeader(String name, String value) {
        addParam(name, value, NameValuePair.TYPE_HEADER);
    }
1033064
function () {
                var children = [],
                    addedDescriptors = [],
                    i, child;

                if (this.$defaultContentName && this.$defaultTemplateName) {
                    throw "both $defaultContentName and $defaultTemplateName are defined";
                }

                var desc;

                function addChildren(childrenFromDescriptor, fromDescriptor) {

                    // don't add children with the same descriptor twice
                    for (var j = 0; j < childrenFromDescriptor.length; j++) {
                        child = childrenFromDescriptor[j];
                        child.$fromDescriptor = fromDescriptor;

                        if (child.$createdByTemplate || _.indexOf(addedDescriptors, child.$descriptor) === -1) {
                            children.push(child);
                            if (child.$descriptor) {
                                addedDescriptors.push(child.$descriptor);
                            }
                        }
                    }
                }

                for (var d = 0; d < this.$internalDescriptors.length; d++) {
                    desc = this.$internalDescriptors[d];
                    addChildren(this._getChildrenFromDescriptor(desc, this, null, this), "intern");
                }

                var externalDescriptorChildren;

                if (this.$defaultTemplateName) {
                    var templateBlock;

                    // go through all children from the external descriptor
                    // and check if a template block with the name $defaultTemplateName

                    for (i = 0; i < this.$descriptor.childNodes.length; i++) {
                        var node = this.$descriptor.childNodes[i];

                        if (node.nodeType === 1 &&
                            node.getAttribute("name") === this.$defaultTemplateName &&
                            this.$stage.$applicationContext.getFqClassName(node.namespaceURI, this._localNameFromDomNode(node), true) === "js/core/Template") {

                            templateBlock = node;
                            break;
                        }
                    }

                    if (!templateBlock && this.$descriptor) {
                        templateBlock = this.createComponent(Component.Template, {
                            name: this.$defaultTemplateName
                        }, this.$descriptor);

                        externalDescriptorChildren = [templateBlock];
                    }

                }

                externalDescriptorChildren = externalDescriptorChildren || this._getChildrenFromDescriptor(this.$descriptor);


                if (this.$defaultContentName && this.$descriptor) {
                    // check if content block is already defined
                    var contentBlock,
                        internAndExternalChildren = children.concat(externalDescriptorChildren);


                    for (i = 0; i < internAndExternalChildren.length; i++) {
                        child = internAndExternalChildren[i];

                        if (child instanceof Component.Content && child.$.name === this.$defaultContentName) {
                            // content block already defined
                            contentBlock = child;
                            break;
                        }
                    }

                    if (!contentBlock) {
                        // create a content block and move all children in a js.core.Content Block
                        contentBlock = this.createComponent(Component.Content, {
                            name: this.$defaultContentName
                        });

                        // add all children to content block
                        for (i = 0; i < externalDescriptorChildren.length; i++) {
                            contentBlock.addChild(externalDescriptorChildren[i]);
                        }

                        externalDescriptorChildren = [contentBlock];
                    }

                }

                addChildren(externalDescriptorChildren, "external");

                var extraChildren = this.createChildren();
                if (extraChildren) {
                    addChildren(extraChildren, "extra");
                }

                this._initializeChildren(children);

                this._childrenInitialized();

                this._initializeXamlEventAttributes(this.$xamlDefaults, this);
                this._initializeXamlEventAttributes(this.$xamlAttributes, this.$rootScope);
            }
1285367
public static Element createParam (String name, String value)
    {
        Element pelem = DOM.createElement("param");
        DOM.setElementProperty(pelem, "name", name);
        DOM.setElementProperty(pelem, "value", value);
        return pelem;
    }