private LinkTool addRequestParams()

in velocity-tools-view/src/main/java/org/apache/velocity/tools/view/LinkTool.java [196:215]


    private LinkTool addRequestParams(boolean ignore, Object... special)
    {
        LinkTool copy = (LinkTool)duplicate(true);
        Map reqParams = request.getParameterMap();
        boolean noSpecial = (special == null || special.length == 0);
        for (Object e : reqParams.entrySet())
        {
            Map.Entry entry = (Map.Entry)e;
            String key = String.valueOf(entry.getKey());
            boolean isSpecial = (!noSpecial && contains(special, key));
            // we actually add the parameter only under three cases:
            //  take all     not one being ignored     one of the privileged few
            if (noSpecial || (ignore && !isSpecial) || (!ignore && isSpecial))
            {
                // this is not one being ignored
                copy.setParam(key, entry.getValue(), this.appendParams);
            }
        }
        return copy;
    }