You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"When placed on a class, it indicates that the class shouldn't be mapped to XML
by itself. Properties on such class will be mapped to XML along with its derived
classes, as if the class is inlined."
Therefore, I expected that, given the code snippet below as an example, the
class Book would not be included in schema.xsd after running schemagen. But
schemagen is including it in the generated XML schema.
@XmlTransient
public class Book {
public String title;
public String author;
public String isbn;
}
@XmlRootElement
public class Library
{ @XmlElementWrapper(name="books") @xmlelement(name="book") @XmlJavaTypeAdapter(BookISBNAdapter.class) public Set book; }
public class BookISBNAdapter extends XmlAdapter<String, Book> {
public String marshal(Book book)
{ return book.isbn; }
public Book unmarshal(String isbn)
{ return BookLookupService.getByISBN(isbn);}
}
Environment
Operating System: All
Platform: All
Affected Versions
[2.2]
The text was updated successfully, but these errors were encountered:
The JAXB javadoc states:
"When placed on a class, it indicates that the class shouldn't be mapped to XML
by itself. Properties on such class will be mapped to XML along with its derived
classes, as if the class is inlined."
Therefore, I expected that, given the code snippet below as an example, the
class Book would not be included in schema.xsd after running schemagen. But
schemagen is including it in the generated XML schema.
@XmlTransient
public class Book {
public String title;
public String author;
public String isbn;
}
@XmlRootElement
public class Library
{ @XmlElementWrapper(name="books") @xmlelement(name="book") @XmlJavaTypeAdapter(BookISBNAdapter.class) public Set book; }
public class BookISBNAdapter extends XmlAdapter<String, Book> {
public String marshal(Book book)
{ return book.isbn; }
public Book unmarshal(String isbn)
{ return BookLookupService.getByISBN(isbn);}
}
Environment
Operating System: All
Platform: All
Affected Versions
[2.2]
The text was updated successfully, but these errors were encountered: