I'm working on a little route for my blog feed, essentially I have a route
that looks like this:

from("rss:...")
.marshal().rss()
.split(xpath("//item"))
.unmarshal(jaxb)
//do stuff to my Article object
.marshal().json(JsonLibrary.Jackson)

My problem is, when I marshal my model object to json I don't want it to
have the same names as the element names from the XML the object was
created from.

So for instance, the model object that is created by JAXB has properties
such as:

@XmlElement(name = "encoded",namespace = "
http://purl.org/rss/1.0/modules/content/";)
@JsonProperty("body")
public void setBody(String body)...

What appears to be happening is the json marshalling seems to be respecting
the element name from the @XmlElement annotation instead of the name given
in the @JsonProperty annotation.  In fact, it appears to ignore all @Json*
annotations for any property that has an @XmlElement annotation associated
with it.  So instead of "body": properties in my json I end up with
"encoded": properties

Has anyone else run into this?  It's pretty maddening :(

Thanks,

Craig

-- 
Craig Tataryn
site: http://www.basementcoders.com/
irc: ThaDon on freenode #basementcoders
twitter: craiger

Reply via email to