Package org.apache.commons.beanutils

Examples of org.apache.commons.beanutils.ConversionException


        if (value == null) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException("No value specified");
            }
        }

        try {
            return (new Float((String) value));
        } catch (Exception e) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException(e);
            }
        }

    }
View Full Code Here


        if (value == null) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException("No value specified");
            }
        }

        try {
            return (new Integer((String) value));
        } catch (Exception e) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException(e);
            }
        }

    }
View Full Code Here

        if (value == null) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException("No value specified");
            }
        }

        try {
            return (new Long((String) value));
        } catch (Exception e) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException(e);
            }
        }

    }
View Full Code Here

        if (value == null) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException("No value specified");
            }
        }

        try {
            return (new Double((String) value));
        } catch (Exception e) {
            if (useDefault) {
                return (defaultValue);
            } else {
                throw new ConversionException(e);
            }
        }

    }
View Full Code Here

                }
               
                try {
                    return formatter.parse(value.toString());
                } catch (ParseException ex) {
                    throw new ConversionException(ex);
                }
            }
        }
       
        ISODateConverter converter = new ISODateConverter();
View Full Code Here

                return getDefaultAs(targetType);
            } else {
                if (e instanceof ConversionException) {
                    throw (ConversionException)e;
                }
                throw new ConversionException(e);
            }
        }
    }
View Full Code Here

            return null;
        }
        if (type.isInstance(result)) {
            return type.cast(result);
        }
        throw new ConversionException("Unsupported target type: " + type);
    }
View Full Code Here

                }
               
                try {
                    return formatter.parse(value.toString());
                } catch (ParseException ex) {
                    throw new ConversionException(ex);
                }
            }
        }
       
        ISODateConverter converter = new ISODateConverter();
View Full Code Here

                }
               
                try {
                    return formatter.parse(value.toString());
                } catch (ParseException ex) {
                    throw new ConversionException(ex);
                }
            }
View Full Code Here

            if (falseStrings[i].equals(stringValue)) {
                return Boolean.FALSE;
            }
        }
       
        throw new ConversionException("Cna't convert value '" + value + "' to a Boolean");
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.beanutils.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.