Package com.alibaba.citrus.service.form

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


     * <li>Field级别的context的所有内容。</li>
     * <li>Validator对象的所有属性。</li>
     * </ol>
     */
    public static MessageContext newInstance(final Field field, final Validator validator) {
        MessageContext validatorContext = new MessageContext() {
            private BeanWrapper validatorWrapper;

            @Override
            protected Object internalGet(String key) {
                if (validatorWrapper == null) {
View Full Code Here


        }
    }

    public boolean isSatisfied(final Context context) {
        TypeConverter converter = context.getField().getGroup().getForm().getTypeConverter();
        ExpressionContext expressionContext = new MessageContext() {
            @Override
            protected Object internalGet(String key) {
                return null;
            }
View Full Code Here

    /**
     * ����һ����ָ��validator��ص�context��ʹ��ָ����value��
     */
    protected final Context newContext(Context context, Validator validator, Object value) {
        MessageContext expressionContext = MessageContextFactory.newInstance(context.getField(), validator);
        expressionContext.copyLocalContext(context.getMessageContext());
        return new ValidatorContextImpl(expressionContext, context.getField(), value);
    }
View Full Code Here

        if (isValid()) {
            boolean found = false;

            for (Validator validator : getFieldConfig().getValidators()) {
                if (isEquals(validator.getId(), id)) {
                    MessageContext expressionContext = MessageContextFactory.newInstance(this, validator);
                    expressionContext.putAll(params);
                    valid = false;
                    found = true;
                    message = validator.getMessage(new ValidatorContextImpl(expressionContext, this));

                    if (message == null) {
View Full Code Here

     */
    protected void validate() {
        valid = true;

        for (Validator validator : getFieldConfig().getValidators()) {
            MessageContext expressionContext = MessageContextFactory.newInstance(this, validator);
            Context context = new ValidatorContextImpl(expressionContext, this);
            boolean passed = validator.validate(context);

            if (!passed) {
                valid = false;
View Full Code Here

     * <li>����ϵͳ���ԣ�<code>System.getProperties()</code>��</li>
     * <li>����С�����磺<code>stringUtil</code>��<code>stringEscapeUtil</code>�ȡ�</li>
     * </ol>
     */
    public static MessageContext newInstance(final Form form) {
        MessageContext formContext = new MessageContext() {
            @Override
            protected Object internalGet(String key) {
                return null;
            }

            @Override
            public ExpressionContext getParentContext() {
                return null;
            }

            @Override
            protected void buildToString(ToStringBuilder sb) {
                sb.append("FormMessageContext");
            }

            @Override
            protected void buildToString(MapBuilder mb) {
                mb.append("form", form);
            }
        };

        Map<String, Object> utils = Utils.getUtils();

        formContext.putAll(System.getProperties());
        formContext.putAll(utils);

        return formContext;
    }
View Full Code Here

     * <li><code>form</code>ָ��ǰ������</li>
     * <li>Group�е�����field��</li>
     * </ol>
     */
    public static MessageContext newInstance(final Group group) {
        MessageContext groupContext = new MessageContext() {
            @Override
            protected Object internalGet(String key) {
                Object value = null;

                // ����fields
View Full Code Here

     * <code>values</code>��<code>defaultValue</code>��<code>defaultValues</code>��
     * </li>
     * </ol>
     */
    public static MessageContext newInstance(final Field field) {
        MessageContext fieldContext = new MessageContext() {
            private BeanWrapper fieldWrapper;

            @Override
            protected Object internalGet(String key) {
                if (fieldWrapper == null) {
View Full Code Here

     * <li>Field�����context���������ݡ�</li>
     * <li>Validator������������ԡ�</li>
     * </ol>
     */
    public static MessageContext newInstance(final Field field, final Validator validator) {
        MessageContext validatorContext = new MessageContext() {
            private BeanWrapper validatorWrapper;

            @Override
            protected Object internalGet(String key) {
                if (validatorWrapper == null) {
View Full Code Here

        }
    }

    public boolean isSatisfied(final Context context) {
        TypeConverter converter = context.getField().getGroup().getForm().getTypeConverter();
        ExpressionContext expressionContext = new MessageContext() {
            @Override
            protected Object internalGet(String key) {
                return null;
            }
View Full Code Here

TOP

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

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.