Package org.directwebremoting

Examples of org.directwebremoting.ConversionException


            if (hasText(id)) {
                Assert.isEncrypted(decipherer, id);
                return new UUID(decipherer.decrypt(id));
            }
            } catch (Exception e) {
                throw new ConversionException(paramType, new IWebMvcException("Could not convert UUID from: " + data, e));
            }
      }
        return null;
    }
View Full Code Here


    @Override public OutboundVariable convertOutbound(Object data, OutboundContext outctx) throws ConversionException {
        try {
            return new NonNestedOutboundVariable(data == null ? "null" : "'" + cipherer.encrypt(((UUID) data).toString()) + "'");
        } catch (Exception e) {
            throw new ConversionException(data.getClass(), new IWebMvcException("Could not generate encrypted UUID from: " + data, e));
        }
    }
View Full Code Here

        return value < 0 ? null : paramType.getEnumConstants()[value];
    }

    @Override public OutboundVariable convertOutbound(Object data, OutboundContext outctx) {
        Class<?> enumClass = data.getClass();
        if (!enumClass.isEnum()) throw new ConversionException(enumClass);
        int pos = -1;
        Object[] enums = enumClass.getEnumConstants();
        for (int index = 0; index < enums.length; index++)
            if (enums[index] == data)
                pos = index;
        if (pos < 0) throw new ConversionException(enumClass);
        return new NonNestedOutboundVariable("{position: " + pos + ", displayable: \'" + messageResolver.getMessage(enumClass.getSimpleName() + "." + ((Enum<?>) data).name(), null, WebContextLocale.getActiveLocale()) + "\'}");
    }
View Full Code Here

            String className = LocalUtil.urlDecode(data.getValue());
            try {
                Assert.isEncrypted(decipherer, className);
                return ClassUtils.forName(decipherer.decrypt(className));
            } catch (Exception cne) {
                throw new ConversionException(paramType, new IWebMvcException("Could not convert class from: " + className, cne));
            }
      }
      return null;
    }
View Full Code Here

        try {
            String name = ClassUtils.getActualClass(data).getName();
            if (name.indexOf("_$$_javassist") > 0) name = name.substring(0, name.indexOf("_$$_javassist"));
            return new NonNestedOutboundVariable(data == null ? "null" : "'" + cipherer.encrypt(name) + "'");
        } catch (Exception e) {
            throw new ConversionException(data.getClass(), new IWebMvcException("Could not generate encrypted class name from: " + data, e));
        }
    }
View Full Code Here

            try {
                String points = data.getValue();
                rating.setRating(hasText(points) ? Double.parseDouble(points) : 0D);
                return rating;
            } catch (Exception e) {
                throw new ConversionException(paramType, new IWebMvcException("Could not convert Rating from: " + data, e));
            }
      }
        return null;
    }
View Full Code Here

            return properties;
        }
        catch (Exception ex)
        {
            throw new ConversionException(clazz, ex);
        }
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.directwebremoting.extend.Converter#convertOutbound(java.lang.Object, org.directwebremoting.extend.OutboundContext)
     */
    public OutboundVariable convertOutbound(Object data, OutboundContext outctx) throws ConversionException
    {
        throw new ConversionException(data.getClass(), "JavascriptObjects can not be passed to a browser");
    }
View Full Code Here

            callback.dataReturned((T) callbackData);
        }
        catch (Exception ex)
        {
            throw new ConversionException(type, ex);
        }
    }
View Full Code Here

                return out.toByteArray();
            }
        }
        catch (IOException ex)
        {
            throw new ConversionException(paramType, ex);
        }

        throw new ConversionException(paramType, "File conversion is not possible for a " + paramType);
    }
View Full Code Here

TOP

Related Classes of org.directwebremoting.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.