Package org.mule.api.transformer

Examples of org.mule.api.transformer.TransformerException


        {
            return PropertyUtils.getProperty(src, this.propertyName);
        }
        catch (Exception e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here


            }
            return result;
        }
        catch (Exception e)
        {
            throw new TransformerException(
                    CoreMessages.transformFailed("byte[]", "Object"), this, e);
        }
    }
View Full Code Here

            IOUtils.copy(input, byteOut);
            return byteOut.toString(outputEncoding);
        }
        catch (IOException e)
        {
            throw new TransformerException(CoreMessages.errorReadingStream(), e);
        }
        finally
        {
            try
            {
View Full Code Here

            handler.write(RequestContext.getEvent(), bytes);
            return bytes.toString(outputEncoding);
        }
        catch (IOException e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here

        {
            return new String(bytes, outputEncoding);
        }
        catch (UnsupportedEncodingException e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here

                }
            };
        }
        else
        {
            throw new TransformerException(MessageFactory
                    .createStaticMessage("Unable to convert " + src.getClass() + " to OutputHandler."));
        }
    }
View Full Code Here

                    return NumberUtils.convertNumberToTargetClass(numberFormat.parse((String) src),
                        getReturnClass());
                }
                catch (Exception e)
                {
                    throw new TransformerException(this, e);
                }
            }
            else
            {
                return NumberUtils.parseNumber((String) src, getReturnClass());
View Full Code Here

        {
            return ((DataHandler) src).getInputStream();
        }
        catch (IOException e)
        {
            throw new TransformerException(this, e);
        }
    }
View Full Code Here

        {
            return new String(bytes, outputEncoding);
        }
        catch (UnsupportedEncodingException uee)
        {
            throw new TransformerException(this, uee);
        }
    }
View Full Code Here

                {
                    return new String(bytes, encoding);
                }
                catch (UnsupportedEncodingException e)
                {
                    throw new TransformerException(this, e);
                }
            }
        }
        else if (src instanceof InputStream)
        {
            try
            {
                PushbackInputStream pushbackStream = new PushbackInputStream((InputStream)src);
                int firstByte = pushbackStream.read();
                pushbackStream.unread((byte)firstByte);
               
                if (this.checkStreamHeader((byte)firstByte))
                {
                    return super.doTransform(pushbackStream, encoding);
                }
                else
                {
                    try
                    {
                        return IOUtils.toString(pushbackStream, encoding);
                    }
                    finally
                    {
                        // this also closes the underlying stream that's stored in src
                        pushbackStream.close();
                    }
                }
            }
            catch (IOException iox)
            {
                throw new TransformerException(this, iox);
            }
        }
        else
        {
            throw new TransformerException(CoreMessages.transformOnObjectUnsupportedTypeOfEndpoint(
                this.getName(), src.getClass(), endpoint));
        }
    }
View Full Code Here

TOP

Related Classes of org.mule.api.transformer.TransformerException

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.