Package org.more.convert

Examples of org.more.convert.ConversionException


     * @throws Throwable if an error occurs converting to the specified type
     */
    @Override
    protected Object convertToType(final Class type, final Object value) throws Throwable {
        if (!type.isArray()) {
            throw new ConversionException(this.toString(this.getClass()) + " cannot handle conversion to '" + this.toString(type) + "' (not an array).");
        }
        // Handle the source
        int size = 0;
        Iterator iterator = null;
        if (value.getClass().isArray()) {
View Full Code Here


                        list.add(st.sval);
                    }
                } else if (ttype == StreamTokenizer.TT_EOF) {
                    break;
                } else {
                    throw new ConversionException("Encountered token of type " + ttype + " parsing elements to '" + this.toString(type) + ".");
                }
            }
            if (list == null) {
                list = Collections.EMPTY_LIST;
            }
            // Return the completed list
            return list;
        } catch (IOException e) {
            throw new ConversionException("Error converting from String to '" + this.toString(type) + "': " + e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of org.more.convert.ConversionException

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.