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

Popular posts from this blog

jQuery Mobile app not scrolling in Firefox -

c++ - How to add Crypto++ library to Qt project -

php array slice every 2th rule -