users@jaxb.java.net

Re: Customizing code generation

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Tue, 19 May 2009 11:01:09 +0200

You use customization, with a bindings file selecting the element node with
an XPath expression and define the property name as you wish. In this case
the file would be

<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               jaxb:version="2.0">
  <jaxb:bindings schemaLocation="
http://webservices.daehosting.com/services/isbnservice.wso?WSDL"
       node="//xsd:schema">
    <jaxb:bindings
node="//xsd:element[@name='IsValidISBN13']//xsd:element[@name='sISBN']">
      <jaxb:property name="Sisbn"/>
    </jaxb:bindings>
    <jaxb:bindings
node="//xsd:element[@name='IsValidISBN10']//xsd:element[@name='sISBN']">
      <jaxb:property name="Sisbn"/>
    </jaxb:bindings>
  </jaxb:bindings>
</jaxb:bindings>

-W


On Mon, May 18, 2009 at 10:56 PM, tog <guillaume.alleon_at_gmail.com> wrote:

>
> I am working with the following wsdl
> http://webservices.daehosting.com/services/isbnservice.wso?WSDL
>
> Using xjc, I get the following java code. Is it possible to tweak the
> compiler to get something like:
> [set/get]Sisbn methods instead of [set/get]SISBN ?
>
> Thanks
> Guillaume
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "", propOrder = {
> "sisbn"
> })
> @XmlRootElement(name = "IsValidISBN13")
> public class IsValidISBN13 {
>
> @XmlElement(name = "sISBN", required = true)
> protected String sisbn;
>
> public String getSISBN() {
> return sisbn;
> }
>
> public void setSISBN(String value) {
> this.sisbn = value;
> }
> }
>
> --
> View this message in context:
> http://www.nabble.com/Customizing-code-generation-tp23605127p23605127.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>