views:

253

answers:

1

Hi.

I have class that represents users. Users are divided into two groups with different id. Could i make something like "if statement", so if (id==1) set annotation on field @XMLTransient

Or the only one way to do this is to create two separate classes ?

+1  A: 

No, annotations are purely compile-time constructs, you can't do that. You'll need to refactor your class model to handle this.

skaffman