Package net.sourceforge.stripes.validation

Examples of net.sourceforge.stripes.validation.TypeConverter


                String stringKey = evaluation.getNode().getStringValue();
                ActionBean bean = (ActionBean) evaluation.getExpressionEvaluation().getBean();
                Locale locale = bean.getContext().getLocale();
                Collection errors = new ArrayList<ValidationError>();

                TypeConverter tc = StripesFilter.getConfiguration()
                        .getTypeConverterFactory().getTypeConverter(declaredType, locale);

                // If there is a type converter, try using it!
                if (tc != null) {
                    Object retval = tc.convert(stringKey, declaredType, errors);
                    if (errors.size() == 0) return retval;
                }
                // Otherwise look for a String constructor
                else {
                    Constructor c = declaredType.getConstructor(String.class);
View Full Code Here


                String stringKey = evaluation.getNode().getStringValue();
                ActionBean bean = (ActionBean) evaluation.getExpressionEvaluation().getBean();
                Locale locale = bean.getContext().getLocale();
                Collection errors = new ArrayList<ValidationError>();

                TypeConverter tc = StripesFilter.getConfiguration()
                        .getTypeConverterFactory().getTypeConverter(declaredType, locale);

                // If there is a type converter, try using it!
                if (tc != null) {
                    Object retval = tc.convert(stringKey, declaredType, errors);
                    if (errors.size() == 0) return retval;
                }
                // Otherwise look for a String constructor
                else {
                    Constructor c = declaredType.getConstructor(String.class);
View Full Code Here

                String stringKey = evaluation.getNode().getStringValue();
                ActionBean bean = (ActionBean) evaluation.getExpressionEvaluation().getBean();
                Locale locale = bean.getContext().getLocale();
                Collection errors = new ArrayList<ValidationError>();

                TypeConverter tc = StripesFilter.getConfiguration()
                        .getTypeConverterFactory().getTypeConverter(declaredType, locale);

                // If there is a type converter, try using it!
                if (tc != null) {
                    Object retval = tc.convert(stringKey, declaredType, errors);
                    if (errors.size() == 0) return retval;
                }
                // Otherwise look for a String constructor
                else {
                    return StripesFilter.getConfiguration().getObjectFactory()
View Full Code Here

import java.util.Locale;

public class CustomTypeConverterFactory extends DefaultTypeConverterFactory{
    @Override
    public TypeConverter getInstance(Class<? extends TypeConverter> aClass, Locale locale) throws Exception {
        TypeConverter converter =  super.getInstance(aClass, locale);
        SpringHelper.injectBeans(converter, StripesFilter.getConfiguration().getServletContext());
        return converter;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.validation.TypeConverter

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.