Package com.alibaba.citrus.service.form

Examples of com.alibaba.citrus.service.form.Form


                fc = null;
            }
        }

        public Object resolve() {
            Form form = formService.getForm();
            Collection<Group> groups = form.getGroups(groupName);

            boolean valid = isValidatedAndValid(form);

            if (fc == null) {
                Object result = null;

                try {
                    result = form.getTypeConverter().convertIfNecessary(groups, context.getTypeInfo().getRawType(),
                                                                        context.getExtraObject(MethodParameter.class));
                } catch (TypeMismatchException e) {
                    if (!isConverterQuiet(form)) {
                        throw e;
                    }

                    return null;
                }

                skipModuleExecutionIfNecessary(valid, result);
                return result;
            } else {
                skipModuleExecutionIfNecessary(valid, null);

                if (!valid) {
                    return null;
                }

                Object[] results = new Object[groups.size()];

                int i = 0;
                for (Group group : groups) {
                    Object object = newInstance(fc);
                    group.setProperties(object);
                    results[i++] = object;
                }

                try {
                    return form.getTypeConverter().convertIfNecessary(results, context.getTypeInfo().getRawType(),
                                                                      context.getExtraObject(MethodParameter.class));
                } catch (TypeMismatchException e) {
                    if (!isConverterQuiet(form)) {
                        throw e;
                    }
View Full Code Here


            assertTrue(componentType != null && !Object.class.equals(componentType), "Invalid paramType: %s",
                       context.getTypeInfo());
        }

        public Object resolve() {
            Form form = formService.getForm();

            // 取得同名group instances中的指定field。
            Collection<Group> groups = form.getGroups(groupName);
            List<Field> fields = new ArrayList<Field>(groups.size());

            for (Group group : groups) {
                fields.add(group.getField(fieldName));
            }

            boolean valid = isValidatedAndValid(form);

            if (componentType.isAssignableFrom(Field.class)) {
                Object result = null;

                try {
                    result = form.getTypeConverter().convertIfNecessary(fields, context.getTypeInfo().getRawType(),
                                                                        context.getExtraObject(MethodParameter.class));
                } catch (TypeMismatchException e) {
                    if (!isConverterQuiet(form)) {
                        throw e;
                    }

                    return null;
                }

                skipModuleExecutionIfNecessary(valid, result);
                return result;
            } else {
                skipModuleExecutionIfNecessary(valid, null);

                if (!valid) {
                    return null;
                }

                Object[] results = new Object[fields.size()];

                for (int i = 0; i < results.length; i++) {
                    try {
                        results[i] = fields.get(i).getValueOfType(componentType,
                                                                  context.getExtraObject(MethodParameter.class), null);
                    } catch (TypeMismatchException e) {
                        if (!isConverterQuiet(form)) {
                            throw e;
                        }

                        results[i] = null;
                    }
                }

                try {
                    return form.getTypeConverter().convertIfNecessary(results, context.getTypeInfo().getRawType(),
                                                                      context.getExtraObject(MethodParameter.class));
                } catch (TypeMismatchException e) {
                    if (!isConverterQuiet(form)) {
                        throw e;
                    }
View Full Code Here

                this.skipIfInvalid = formAnnotation.skipIfInvalid();
            }
        }

        public Object resolve() {
            Form form = formService.getForm();
            skipModuleExecutionIfNecessary(isValidatedAndValid(form), form);
            return form;
        }
View Full Code Here

                fc = null;
            }
        }

        public Object resolve() {
            Form form = formService.getForm();
            Group group = form.getGroup(groupName, groupInstanceKey);

            boolean valid = isValidatedAndValid(form);

            if (fc == null) {
                skipModuleExecutionIfNecessary(valid, group);
View Full Code Here

            groupInstanceKey = trimToNull(fieldAnnotation.groupInstanceKey());
            skipIfInvalid = fieldAnnotation.skipIfInvalid();
        }

        public Object resolve() {
            Form form = formService.getForm();
            Group group = form.getGroup(groupName, groupInstanceKey);
            Field field = group.getField(fieldName);

            boolean valid = isValidatedAndValid(form);

            if (context.getTypeInfo().getRawType().isAssignableFrom(Field.class)) {
View Full Code Here

                this.skipIfInvalid = formAnnotation.skipIfInvalid();
            }
        }

        public Object resolve() {
            Form form = formService.getForm();
            skipModuleExecutionIfNecessary(isValidatedAndValid(form), form);
            return form;
        }
View Full Code Here

                fc = null;
            }
        }

        public Object resolve() {
            Form form = formService.getForm();
            Group group = form.getGroup(groupName, groupInstanceKey);

            boolean valid = isValidatedAndValid(form);

            if (fc == null) {
                skipModuleExecutionIfNecessary(valid, group);
View Full Code Here

            groupInstanceKey = trimToNull(fieldAnnotation.groupInstanceKey());
            skipIfInvalid = fieldAnnotation.skipIfInvalid();
        }

        public Object resolve() {
            Form form = formService.getForm();
            Group group = form.getGroup(groupName, groupInstanceKey);
            Field field = group.getField(fieldName);

            boolean valid = isValidatedAndValid(form);

            if (context.getTypeInfo().getRawType().isAssignableFrom(Field.class)) {
View Full Code Here

                fc = null;
            }
        }

        public Object resolve() {
            Form form = formService.getForm();
            Collection<Group> groups = form.getGroups(groupName);

            boolean valid = isValidatedAndValid(form);

            if (fc == null) {
                Object result = null;

                try {
                    result = form.getTypeConverter().convertIfNecessary(groups, context.getTypeInfo().getRawType(),
                            context.getExtraObject(MethodParameter.class));
                } catch (TypeMismatchException e) {
                    if (!isConverterQuiet(form)) {
                        throw e;
                    }

                    return null;
                }

                skipModuleExecutionIfNecessary(valid, result);
                return result;
            } else {
                skipModuleExecutionIfNecessary(valid, null);

                if (!valid) {
                    return null;
                }

                Object[] results = new Object[groups.size()];

                int i = 0;
                for (Group group : groups) {
                    Object object = newInstance(fc);
                    group.setProperties(object);
                    results[i++] = object;
                }

                try {
                    return form.getTypeConverter().convertIfNecessary(results, context.getTypeInfo().getRawType(),
                            context.getExtraObject(MethodParameter.class));
                } catch (TypeMismatchException e) {
                    if (!isConverterQuiet(form)) {
                        throw e;
                    }
View Full Code Here

            assertTrue(componentType != null && !Object.class.equals(componentType), "Invalid paramType: %s",
                    context.getTypeInfo());
        }

        public Object resolve() {
            Form form = formService.getForm();

            // ȡ��ͬ��group instances�е�ָ��field��
            Collection<Group> groups = form.getGroups(groupName);
            List<Field> fields = new ArrayList<Field>(groups.size());

            for (Group group : groups) {
                fields.add(group.getField(fieldName));
            }

            boolean valid = isValidatedAndValid(form);

            if (componentType.isAssignableFrom(Field.class)) {
                Object result = null;

                try {
                    result = form.getTypeConverter().convertIfNecessary(fields, context.getTypeInfo().getRawType(),
                            context.getExtraObject(MethodParameter.class));
                } catch (TypeMismatchException e) {
                    if (!isConverterQuiet(form)) {
                        throw e;
                    }

                    return null;
                }

                skipModuleExecutionIfNecessary(valid, result);
                return result;
            } else {
                skipModuleExecutionIfNecessary(valid, null);

                if (!valid) {
                    return null;
                }

                Object[] results = new Object[fields.size()];

                for (int i = 0; i < results.length; i++) {
                    try {
                        results[i] = fields.get(i).getValueOfType(componentType,
                                context.getExtraObject(MethodParameter.class), null);
                    } catch (TypeMismatchException e) {
                        if (!isConverterQuiet(form)) {
                            throw e;
                        }

                        results[i] = null;
                    }
                }

                try {
                    return form.getTypeConverter().convertIfNecessary(results, context.getTypeInfo().getRawType(),
                            context.getExtraObject(MethodParameter.class));
                } catch (TypeMismatchException e) {
                    if (!isConverterQuiet(form)) {
                        throw e;
                    }
View Full Code Here

TOP

Related Classes of com.alibaba.citrus.service.form.Form

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.