Package com.alibaba.citrus.service.form

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


    @Override
    protected boolean validate(Context context, String value) {
        if (fieldValues != null) {
            for (Map.Entry<String, String> entry : fieldValues.entrySet()) {
                Field f = context.getField(entry.getKey());

                if (!f.getStringValue().equals(entry.getValue())) {
                    return false;
                }
            }
        }
View Full Code Here


            this.group = group;
        }

        /** 取得指定名称的field helper。 */
        public FieldHelper get(String fieldName) {
            Field field = group.getField(fieldName);
            return field == null ? null : new FieldHelper(field);
        }
View Full Code Here

    }

    /** 验证一个字段。 */
    @Override
    protected boolean validate(Context context, String value) {
        Field fieldToCompare = assertNotNull(context.getField(fieldName), "field not found");
        String thisValue = value;
        String otherValue = fieldToCompare.getStringValue();

        if (ignoreCase) {
            thisValue = StringUtil.toLowerCase(thisValue);
            otherValue = StringUtil.toLowerCase(otherValue);
        }
View Full Code Here

        }

        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)) {
                skipModuleExecutionIfNecessary(valid, field);
                return field;
            } else {
                skipModuleExecutionIfNecessary(valid, null);

                if (valid) {
                    try {
                        return field.getValueOfType(context.getTypeInfo().getRawType(),
                                                    context.getExtraObject(MethodParameter.class), null);
                    } catch (TypeMismatchException e) {
                        if (!isConverterQuiet(form)) {
                            throw e;
                        }
View Full Code Here

            this.group = group;
        }

        /** 取得指定名称的field helper。 */
        public FieldHelper get(String fieldName) {
            Field field = group.getField(fieldName);
            return field == null ? null : new FieldHelper(field);
        }
View Full Code Here

    }

    /** 验证一个字段。 */
    @Override
    protected boolean validate(Context context, String value) {
        Field fieldToCompare = assertNotNull(context.getField(fieldName), "field not found");
        NumberSupport thisValue = new NumberSupport(getNumberType(), value);
        NumberSupport otherValue = new NumberSupport(getNumberType(), fieldToCompare.getStringValue());

        try {
            return getOp().accept(thisValue.compareTo(otherValue));
        } catch (IllegalArgumentException e) {
            return false; // 包括NumberFormatException。如果getValue失败,验证失败。
View Full Code Here

        }

        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)) {
                skipModuleExecutionIfNecessary(valid, field);
                return field;
            } else {
                skipModuleExecutionIfNecessary(valid, null);

                if (valid) {
                    try {
                        return field.getValueOfType(context.getTypeInfo().getRawType(),
                                context.getExtraObject(MethodParameter.class), null);
                    } catch (TypeMismatchException e) {
                        if (!isConverterQuiet(form)) {
                            throw e;
                        }
View Full Code Here

        fields.clear();
        valid = true;
        validated = request != null;

        for (FieldConfig fieldConfig : getGroupConfig().getFieldConfigList()) {
            Field field = new FieldImpl(fieldConfig, this);

            fields.put(StringUtil.toLowerCase(fieldConfig.getName()), field);
            field.init(request);
        }

        // ������֤���ֶΣ���Щvalidator��Ҫ��ȡ����ֶε�ֵ����������Ϊ�˱�����Щvalidator��������������field��ֵ��
        if (request != null) {
            for (Field field : fields.values()) {
View Full Code Here

    /**
     * ��֤һ���ֶΡ�
     */
    @Override
    protected boolean validate(Context context, String value) {
        Field fieldToCompare = assertNotNull(context.getField(fieldName), "field not found");
        NumberSupport thisValue = new NumberSupport(getNumberType(), value);
        NumberSupport otherValue = new NumberSupport(getNumberType(), fieldToCompare.getStringValue());

        try {
            return getOp().accept(thisValue.compareTo(otherValue));
        } catch (IllegalArgumentException e) {
            return false; // ����NumberFormatException�����getValueʧ�ܣ���֤ʧ�ܡ�
View Full Code Here

        /**
         * ȡ��ָ�����Ƶ�field helper��
         */
        public FieldHelper get(String fieldName) {
            Field field = group.getField(fieldName);
            return field == null ? null : new FieldHelper(field);
        }
View Full Code Here

TOP

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

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.