You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by Hilco Wijbenga <hi...@gmail.com> on 2007/01/20 08:29:02 UTC

Customised method name

I was hoping the following would generate "hasSomething" as a method
name instead of "isSomething". I get an error that xjb:bindings is an
unknown child element of xjb:schemaBindings.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
  jxb:version="1.0"
  xmlns:abc="http://abc.org"
  targetNamespace="http://abc.org"
  elementFormDefault="qualified"
>
  </snip>
  <xsd:complexType name="Xyz">
    <xsd:attribute name="something" type="xsd:boolean">
      <xsd:annotation>
        <xsd:appinfo>
          <jxb:schemaBindings>
            <jxb:bindings>
              <jxb:property name="hasSomething"/>
            </jxb:bindings>
          </jxb:schemaBindings>
        </xsd:appinfo>
      </xsd:annotation>
    </xsd:attribute>
  </xsd:complexType>
</xsd:schema>

To the best of my knowledge the above is correct (at least Eclipse
seems to like it). Am I doing something wrong? Or does JaxMe simply
not support this? The FAQ seem to hint that it might work...

Cheers,
Hilco

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Customised method name

Posted by Jochen Wiedmann <jo...@gmail.com>.
On 1/20/07, Hilco Wijbenga <hi...@gmail.com> wrote:

> Still ... should this have "worked" (i.e. not thrown an exception)?

The "schemaBindings" and "bindings" elements must be removed.

Jochen

-- 
How fast can a year go? As fast as your childs first year.

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Customised method name

Posted by Hilco Wijbenga <hi...@gmail.com>.
On 1/20/07, Jochen Wiedmann <jo...@gmail.com> wrote:
> On 1/20/07, Hilco Wijbenga <hi...@gmail.com> wrote:
>
> > I was hoping the following would generate "hasSomething" as a method
> > name instead of "isSomething". I get an error that xjb:bindings is an
> > unknown child element of xjb:schemaBindings.
>
> Sorry, but it doesn't. You can configure the *property* name. However,
> the *method* names are always using the prefix "set", "get", or "is".

I was afraid of that. :-)

Still ... should this have "worked" (i.e. not thrown an exception)?

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: Customised method name

Posted by Jochen Wiedmann <jo...@gmail.com>.
On 1/20/07, Hilco Wijbenga <hi...@gmail.com> wrote:

> I was hoping the following would generate "hasSomething" as a method
> name instead of "isSomething". I get an error that xjb:bindings is an
> unknown child element of xjb:schemaBindings.

Sorry, but it doesn't. You can configure the *property* name. However,
the *method* names are always using the prefix "set", "get", or "is".

Jochen

-- 
How fast can a year go? As fast as your childs first year.

---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org