Package org.apache.tapestry5.json

Examples of org.apache.tapestry5.json.JSONArray


     */
    public void commit()
    {
        for (String field : validations.keys())
        {
            JSONArray specs = validations.getJSONArray(field);

            JSONArray parameters = new JSONArray();
            parameters.put(field);
            parameters.put(specs);

            renderSupport.addInit("validate", parameters);
        }
    }
View Full Code Here


        {
            addInitFunctionInvocation(functionName, parameters[0]);
            return;
        }

        JSONArray array = new JSONArray();

        for (String parameter : parameters)
        {
            array.put(parameter);
        }

        addInitFunctionInvocation(functionName, array);
    }
View Full Code Here

    private void addInitFunctionInvocation(String functionName, Object parameters)
    {
        Defense.notBlank(functionName, "functionName");
        Defense.notNull(parameters, "parameters");

        JSONArray invocations = init.has(functionName) ? init.getJSONArray(functionName) : null;

        if (invocations == null)
        {
            invocations = new JSONArray();
            init.put(functionName, invocations);
        }

        invocations.put(parameters);
    }
View Full Code Here

    {
        ByteArrayOutputStream result = new ByteArrayOutputStream();

        ObjectInputStream inputStream = clientDataEncoder.decodeClientData(clientData);

        JSONArray paths = new JSONArray();

        int count = inputStream.readInt();

        for (int i = 0; i < count; i++)
        {
            String path = inputStream.readUTF();

            streamPath(path, result);

            // Add the context path prefix to the path (which is within the context) so that the
            // loaded script URL can be properly tracked on the client side.

            paths.put(request.getContextPath() + path);

        }

        // Need to add some text to the result.
View Full Code Here

        }

        // Let subclasses do more.
        configure(config);

        renderSupport.addInit("autocompleter", new JSONArray(id, menuId, link.toAbsoluteURI(), config));
    }
View Full Code Here

        // an opportunity to get the submitting element's value into the request properly.

        String raw = request.getParameter(SUBMITTING_ELEMENT_ID);

        if (InternalUtils.isNonBlank(raw) &&
                new JSONArray(raw).getString(1).equals(InternalConstants.CANCEL_NAME))
        {
            return true;
        }

        return false;
View Full Code Here

            return this;
        }

        public void with(Object... arguments)
        {
            this.arguments = new JSONArray(arguments);
        }
View Full Code Here

        // an opportunity to get the submitting element's value into the request properly.

        String raw = request.getParameter(SUBMITTING_ELEMENT_ID);

        if (InternalUtils.isNonBlank(raw) &&
                new JSONArray(raw).getString(1).equals(InternalConstants.CANCEL_NAME))
        {
            return true;
        }

        return false;
View Full Code Here

            pureInits.add(name);
            InternalUtils.addToMapList(inits, priority, name);
        } else
        {

            JSONArray init = new JSONArray();

            init.put(name);

            init.putAll(arguments);

            InternalUtils.addToMapList(inits, priority, init);
        }

        initCount++;
View Full Code Here

                convert(inits)));
    }

    private String convert(List<?> input)
    {
        return new JSONArray().putAll(input).toString(compactJSON);
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.json.JSONArray

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.