Package play.data.binding

Examples of play.data.binding.RootParamNode


      // all composites objects (simple entity, list and maps) are managed
      // by this function
      // v1.0.x code
      // bw.bind(name, o.getClass(), params, "", o);

            RootParamNode paramNode = RootParamNode.convert(params);
            // no http params to bind this object ? so we won't try to bind this object
            if(paramNode.getChild(name) == null) {
                return null;
            }
      // v1.1 compliant

            bw.bind(name, (Type)o.getClass(), params, "", o, o.getClass().getAnnotations());
View Full Code Here


            } else {
                params.putAll(Scope.Params.current().all());
            }
            Logger.trace("getActionMethodArgs name [" + paramsNames[i] + "] annotation [" + Utils.join(method.getParameterAnnotations()[i], " ") + "]");

            RootParamNode root = ParamNode.convert(params);
            rArgs[i] = Binder.bind(
                        root,
                        paramsNames[i],
                        method.getParameterTypes()[i],
                        method.getGenericParameterTypes()[i],
View Full Code Here

                        @SuppressWarnings("unchecked")
                        Class<Model> cType = (Class<Model>)Play.classloader.loadClass(type);
                        final Map<String, String[]> resolvedFields = resolveDependencies(cType, fields);

                        RootParamNode rootParamNode = ParamNode.convert(resolvedFields);
                        // This is kind of hacky. This basically says that if we have an embedded class we should ignore it.
                        if (Model.class.isAssignableFrom(cType)) {

                            Model model = (Model) Binder.bind(rootParamNode, "object", cType, cType, null);
                            for(Field f : model.getClass().getFields()) {
View Full Code Here

        String[] paramsNames = parameterNames(method);
        if (paramsNames == null && method.getParameterTypes().length > 0) {
            throw new UnexpectedException("Parameter names not found for method " + method);
        }

        RootParamNode rootParamNode = ParamNode.convert(args);

        Object[] rArgs = new Object[method.getParameterTypes().length];
        for (int i = 0; i < method.getParameterTypes().length; i++) {
            rArgs[i] = Binder.bind(rootParamNode, paramsNames[i], method.getParameterTypes()[i], method.getGenericParameterTypes()[i], method.getParameterAnnotations()[i]);
        }
View Full Code Here

    }

    public JPABase create(String entity, String name, Params params) throws Exception {
        Object o = Play.classloader.loadClass(entity).newInstance();

        RootParamNode rootParamNode = ParamNode.convert(params.all());

        return ((GenericModel) o).edit(rootParamNode, name);
    }
View Full Code Here

    }

    public JPABase create(String entity, String name, Params params) throws Exception {
        Object o = Play.classloader.loadClass(entity).newInstance();

        RootParamNode rootParamNode = ParamNode.convert(params.all());

        return ((GenericModel) o).edit(rootParamNode, name);
    }
View Full Code Here

        String[] paramsNames = parameterNames(method);
        if (paramsNames == null && method.getParameterTypes().length > 0) {
            throw new UnexpectedException("Parameter names not found for method " + method);
        }

        RootParamNode rootParamNode = ParamNode.convert(args);

        Object[] rArgs = new Object[method.getParameterTypes().length];
        for (int i = 0; i < method.getParameterTypes().length; i++) {
            rArgs[i] = Binder.bind(rootParamNode, paramsNames[i], method.getParameterTypes()[i], method.getGenericParameterTypes()[i], method.getParameterAnnotations()[i]);
        }
View Full Code Here

                    if(index < 0) {
                        return false;
                    }
                    otherKey = to;

                    RootParamNode rootParamNode = Scope.Params.current().getRootParamNode();
                    Class<?> clazz = method.getParameterTypes()[index];
                    Type type = method.getGenericParameterTypes()[index];

                    otherValue = Binder.bind(rootParamNode, to, clazz, type, method.getParameterAnnotations()[index]);
View Full Code Here

            } else {
                params.putAll(Scope.Params.current().all());
            }
            Logger.trace("getActionMethodArgs name [" + paramsNames[i] + "] annotation [" + Utils.join(method.getParameterAnnotations()[i], " ") + "]");

            RootParamNode root = ParamNode.convert(params);
            rArgs[i] = Binder.bind(
                        root,
                        paramsNames[i],
                        method.getParameterTypes()[i],
                        method.getGenericParameterTypes()[i],
View Full Code Here

                        @SuppressWarnings("unchecked")
                        Class<Model> cType = (Class<Model>)Play.classloader.loadClass(type);
                        final Map<String, String[]> resolvedFields = resolveDependencies(cType, fields, idCache);

                        RootParamNode rootParamNode = ParamNode.convert(resolvedFields);
                        // This is kind of hacky. This basically says that if we have an embedded class we should ignore it.
                        if (Model.class.isAssignableFrom(cType)) {

                            Model model = (Model) Binder.bind(rootParamNode, "object", cType, cType, annotations);
                            for(Field f : model.getClass().getFields()) {
View Full Code Here

TOP

Related Classes of play.data.binding.RootParamNode

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.