> -----Original Message-----
> From: KARR, DAVID (ATTCINW)
> 
> I currently use @Xml annotations to specify the fields I want to
> include
> in my REST responses.  I'm seeing a situation where I might need to
> augment that with either XML config, or even dynamic code.  The only
> changes I would make in the XML config or dynamic code would be to
> exclude certain fields.  If it's too hard to use both annotations and
> XML config, I would use XML config entirely.
> 
> Can someone describe my choices for how I might get this done?

Not that this is ideal, but could I define a base concrete (or abstract)
class that defines all the available fields with @XmlElement annotations
(on the field and/or the getter), then defined subclasses that override
some of the getter methods, along with "@XmlIgnore" annotations on those
getter methods?  I would do path mapping for different channels to the
derived classes, as opposed to the base class.

Would this at least allow me some flexibility in omitting some fields
when requests come from (by convention) certain channels?

Reply via email to