Package org.directwebremoting

Examples of org.directwebremoting.ConversionException


            Method setter = LocalUtil.getWriteMethod(bean.getClass(), descriptor);
            setter.invoke(bean, value);
        }
        catch (InvocationTargetException ex)
        {
            throw new ConversionException(bean.getClass(), ex.getTargetException());
        }
        catch (Exception ex)
        {
            throw new ConversionException(bean.getClass(), ex);
        }
    }
View Full Code Here


    public Property createChild(int newParameterNumber) throws ConversionException
    {
        Method method = descriptor.getReadMethod();
        if (method == null)
        {
            throw new ConversionException(descriptor.getPropertyType(), "Property \"" + descriptor.getDisplayName() + "\" of type " + descriptor.getPropertyType().getName() + " has no read method (getter).");
        }
        // Type[] types = method.getGenericParameterTypes();
        // if (types.length == 0)
        // {
        //     return new NestedProperty(this, method, null, 0, newParameterNumber);
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(), "JavascriptFunctions can not be passed to a browser");
    }
View Full Code Here

        }

        if (!value.startsWith(ProtocolConstants.INBOUND_MAP_START) || !value.endsWith(ProtocolConstants.INBOUND_MAP_END))
        {
            log.warn("Expected object while converting data for " + paramType.getName() + " in " + data.getContext().getCurrentProperty() + ". Passed: " + value);
            throw new ConversionException(paramType, "Data conversion error. See logs for more details.");
        }

        value = value.substring(1, value.length() - 1);

        try
        {
            // Loop through the properties passed in
            Map<String, String> tokens = extractInboundTokens(paramType, value);

            if (paramsString == null)
            {
                return createUsingSetterInjection(paramType, data, tokens);
            }
            else
            {
                return createUsingConstructorInjection(paramType, data, tokens);
            }
        }
        catch (InvocationTargetException ex)
        {
            throw new ConversionException(paramType, ex.getTargetException());
        }
        catch (ConversionException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new ConversionException(paramType, ex);
        }
    }
View Full Code Here

        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new ConversionException(data.getClass(), ex);
        }

        ov.setChildren(ovs);

        return ov;
View Full Code Here

            }

            int colonpos = token.indexOf(ProtocolConstants.INBOUND_MAP_ENTRY);
            if (colonpos == -1)
            {
                throw new ConversionException(paramType, "Missing " + ProtocolConstants.INBOUND_MAP_ENTRY + " in object description: " + token);
            }

            String key = token.substring(0, colonpos).trim();
            String val = token.substring(colonpos + 1).trim();
            tokens.put(key, val);
View Full Code Here

            else if (paramType == Element.class)
            {
                return doc.getRootElement();
            }

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

                xml.flush();
                script = EnginePrivate.xmlStringToJavascriptDomElement(xml.toString());
            }
            else
            {
                throw new ConversionException(data.getClass());
            }

            OutboundVariable ov = new NonNestedOutboundVariable(script);

            outctx.put(data, ov);

            return ov;
        }
        catch (ConversionException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new ConversionException(data.getClass(), ex);
        }
    }
View Full Code Here

            else if (paramType == Element.class)
            {
                return doc.getRootElement();
            }

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

        try
        {
            // Using XSLT to convert to a stream. Setup the source
            if (!(data instanceof Node))
            {
                throw new ConversionException(data.getClass());
            }

            Node node = (Node) data;

            String script;
            if (data instanceof Element)
            {
                script = EnginePrivate.xmlStringToJavascriptDomElement(node.toXML());
            }
            else
            {
                script = EnginePrivate.xmlStringToJavascriptDomDocument(node.toXML());
            }

            OutboundVariable ov = new NonNestedOutboundVariable(script);
            outctx.put(data, ov);

            return ov;
        }
        catch (ConversionException ex)
        {
            throw ex;
        }
        catch (Exception ex)
        {
            throw new ConversionException(data.getClass(), ex);
        }
    }
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.