Package com.opensymphony.xwork2.conversion.impl

Examples of com.opensymphony.xwork2.conversion.impl.XWorkConverter.convertValue()


                    Object valueItem = Array.get(value, i);
                    Array.set(result, i, converter.convertValue(context, target, member, propertyName, valueItem, componentType));
                }
            } else {
                result = Array.newInstance(componentType, 1);
                Array.set(result, 0, converter.convertValue(context, target, member, propertyName, value, componentType));
            }
        }

        return result;
    }
View Full Code Here


    private Object doConvertToCollection(Map<String, Object> context, Object o, Member member, String prop, Object value, Class toType) {
        TypeConverter converter = objectFactory.buildConverter(CollectionConverter.class);
        if (converter == null) {
            throw new XWorkException("TypeConverter with name [#0] must be registered first!", XWorkConstants.COLLECTION_CONVERTER);
        }
        return converter.convertValue(context, o, member, prop, value, toType);
    }

    private Object doConvertToArray(Map<String, Object> context, Object o, Member member, String prop, Object value, Class toType) {
        TypeConverter converter = objectFactory.buildConverter(ArrayConverter.class);
        if (converter == null) {
View Full Code Here

    private Object doConvertToArray(Map<String, Object> context, Object o, Member member, String prop, Object value, Class toType) {
        TypeConverter converter = objectFactory.buildConverter(ArrayConverter.class);
        if (converter == null) {
            throw new XWorkException("TypeConverter with name [#0] must be registered first!", XWorkConstants.ARRAY_CONVERTER);
        }
        return converter.convertValue(context, o, member, prop, value, toType);
    }

    private Object doConvertToDate(Map<String, Object> context, Object value, Class toType) {
        TypeConverter converter = objectFactory.buildConverter(DateConverter.class);
        if (converter == null) {
View Full Code Here

    private Object doConvertToDate(Map<String, Object> context, Object value, Class toType) {
        TypeConverter converter = objectFactory.buildConverter(DateConverter.class);
        if (converter == null) {
            throw new XWorkException("TypeConverter with name [#0] must be registered first!", XWorkConstants.DATE_CONVERTER);
        }
        return converter.convertValue(context, null, null, null, value, toType);
    }

    private Object doConvertToNumber(Map<String, Object> context, Object value, Class toType) {
        TypeConverter converter = objectFactory.buildConverter(NumberConverter.class);
        if (converter == null) {
View Full Code Here

    private Object doConvertToNumber(Map<String, Object> context, Object value, Class toType) {
        TypeConverter converter = objectFactory.buildConverter(NumberConverter.class);
        if (converter == null) {
            throw new XWorkException("TypeConverter with name [#0] must be registered first!", XWorkConstants.NUMBER_CONVERTER);
        }
        return converter.convertValue(context, null, null, null, value, toType);
    }

    private Object doConvertToString(Map<String, Object> context, Object value) {
        TypeConverter converter = objectFactory.buildConverter(StringConverter.class);
        if (converter == null) {
View Full Code Here

    private Object doConvertToString(Map<String, Object> context, Object value) {
        TypeConverter converter = objectFactory.buildConverter(StringConverter.class);
        if (converter == null) {
            throw new XWorkException("TypeConverter with name [#0] must be registered first!", XWorkConstants.STRING_CONVERTER);
        }
        return converter.convertValue(context, null, null, null, value, null);
    }
}
View Full Code Here

        }


        if (tc != null) {
            try {
                return tc.convertValue(context, target, member, property, value, toClass);
            } catch (Exception e) {
                if (LOG.isDebugEnabled())
                    LOG.debug("unable to convert value using type converter [#0]", e, tc.getClass().getName());
                handleConversionException(context, property, value, target);
View Full Code Here

        }


        if (tc != null) {
            try {
                return tc.convertValue(context, target, member, property, value, toClass);
            } catch (Exception e) {
                if (LOG.isDebugEnabled())
                    LOG.debug("unable to convert value using type converter [#0]", e, tc.getClass().getName());
                handleConversionException(context, property, value, target);
View Full Code Here

        }


        if (tc != null) {
            try {
                return tc.convertValue(context, target, member, property, value, toClass);
            } catch (Exception e) {
                if (LOG.isDebugEnabled())
                    LOG.debug("unable to convert value using type converter [#0]", e, tc.getClass().getName());
                handleConversionException(context, property, value, target);
View Full Code Here

                }
            }
        }

        XWorkConverter conv = ((Container)stack.getContext().get(ActionContext.CONTAINER)).getInstance(XWorkConverter.class);
        return conv.convertValue(stack.getContext(), result, asType);
    }

    /**
     * Returns a set from comma delimted Strings.
     * @param s The String to parse.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.