else
{
Message msg = CoreMessages.transformOnObjectUnsupportedTypeOfEndpoint(getName(),
src.getClass(), endpoint);
/// FIXME
throw new TransformerMessagingException(msg, event, this);
}
}
if (logger.isDebugEnabled())
{
logger.debug(String.format("Applying transformer %s (%s)", getName(), getClass().getName()));
logger.debug(String.format("Object before transform: %s", StringMessageUtils.toString(src)));
}
MuleMessage message;
if (src instanceof MuleMessage)
{
message = (MuleMessage) src;
}
else if (muleContext.getConfiguration().isAutoWrapMessageAwareTransform())
{
message = new DefaultMuleMessage(src, muleContext);
}
else
{
if (event == null)
{
throw new TransformerMessagingException(CoreMessages.noCurrentEventForTransformer(), event, this);
}
message = event.getMessage();
if (!message.getPayload().equals(src))
{
throw new IllegalStateException("Transform payload does not match current event");
}
}
Object result;
try
{
result = transformMessage(message, enc);
}
catch (TransformerException e)
{
throw new TransformerMessagingException(e.getI18nMessage(), event, this, e);
}
if (result == null)
{
result = NullPayload.getInstance();