Yes, you can use it.

From: Santiago Miguel Aranda Rojas 
Sent: Tuesday, June 23, 2009 11:11 AM
To: [email protected] 
Subject: Re: Fwd: @XmlTransient



I want to use Annotation @XmlTransient in order to filter an attribute of one 
class in the client response. I mean my web service is going to return a 
"Employee" but I dont want return its "department" attribute. Because it is 
neccesary in order to avoid cyclic references. Have you check if I can use 
these annotations using tuscany.

https://jaxb.dev.java.net/guide/Mapping_cyclic_references_to_XML.html
class Department {
  String name;
  List<Employee> employees;
}

class Employee {
  @XmlTransient
  Department department;  // parent pointer
  String name;
  
  public void afterUnmarshal(Unmarshaller u, Object parent) {
    this.department = (Department)parent;
  }
}

Reply via email to