Package com.thoughtworks.xstream.converters

Examples of com.thoughtworks.xstream.converters.ConversionException


                return calendar;
            } catch (IllegalArgumentException e) {
                // try with next formatter
            }
        }
        throw new ConversionException("Cannot parse date " + str);
    }
View Full Code Here


                return declaringClass.getDeclaredMethod(methodName, parameterTypes);
            } else {
                return declaringClass.getDeclaredConstructor(parameterTypes);
            }
        } catch (ClassNotFoundException e) {
            throw new ConversionException(e);
        } catch (NoSuchMethodException e) {
            throw new ConversionException(e);
        }
    }
View Full Code Here

                } else {
                    return FACTORY.element(declaringClass, methodName, fileName);
                }
            }
        } else {
            throw new ConversionException("Could not parse StackTraceElement : " + str);
        }
    }
View Full Code Here

                handler = (InvocationHandler) context.convertAnother(null, handlerType);
            }
            reader.moveUp();
        }
        if (handler == null) {
            throw new ConversionException("No InvocationHandler specified for dynamic proxy");
        }
        Class[] interfacesAsArray = new Class[interfaces.size()];
        interfaces.toArray(interfacesAsArray);
        return Proxy.newProxyInstance(classLoader, interfacesAsArray, handler);
    }
View Full Code Here

                    str.equals("double") ? double.class :
                    str.equals("char") ? char.class :
                    str.equals("short") ? short.class :
                    Class.forName(str, false, classLoader);
        } catch (ClassNotFoundException e) {
            throw new ConversionException("Cannot load java class " + str, e);
        }
    }
View Full Code Here

        try {
            final Field field = StackTraceElement.class.getDeclaredField(fieldName);
            field.setAccessible(true);
            field.set(element, value);
        } catch (Exception e) {
            throw new ConversionException(e);
        }
    }
View Full Code Here

            } else {
                result.pushCallback(callback);
            }
            return result;
        } catch (IOException e) {
            throw new ConversionException("Cannot create CustomObjectStream", e);
        }
    }
View Full Code Here

            } else {
                result.pushCallback(callback);
            }
            return result;
        } catch (IOException e) {
            throw new ConversionException("Cannot create CustomObjectStream", e);
        }
    }
View Full Code Here

        }
        return wrap;
    }

    private ConversionException createConversionException(Throwable e) {
        final ConversionException conversionException = new ConversionException(e);
        StackTraceElement[] ste = e.getStackTrace();
        if (ste!=null){
            for(StackTraceElement top : ste){
                String className=top.getClassName();
                if (className.startsWith("org.apache.jmeter.")){
                    conversionException.add("first-jmeter-class", top.toString());
                    break;
                }
            }
        }
        return conversionException;
View Full Code Here

        }
        return wrap;
    }

    private ConversionException createConversionException(Throwable e) {
        final ConversionException conversionException = new ConversionException(e);
        StackTraceElement[] ste = e.getStackTrace();
        if (ste!=null){
            for(StackTraceElement top : ste){
                String className=top.getClassName();
                if (className.startsWith("org.apache.jmeter.")){
                    conversionException.add("first-jmeter-class", top.toString());
                    break;
                }
            }
        }
        return conversionException;
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.converters.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.