java - JAXB marshalling for function with arguments -
is possible use jaxb create xml attribute function includes parameter? i'd this:
@xmlrootelement public class app { @xmlattribute public boolean isowned( user user ) { return user.ownsapp( getid( ) ); } }
how can user parameter function call when marshalling app class xml? i'm not concerned unmarshalling.
jaxb (jsr-222) limits use of annotations field (i.e. foo
) or property (i.e. bar
). can not use on arbitrary method per 1 in question.
@xmlrootelement public class app { @xmlattribute // valid private boolean foo; private boolean bar; @xmlattribute // valid public boolean isbar() { return bar; } @xmlattribute // invalid public boolean isowned( user user ) { return user.ownsapp( getid( ) ); } }
Comments
Post a Comment