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 ja...@ws.apache.org on 2004/08/12 02:27:19 UTC

[jira] Closed: (JAXME-21) NullPointerException when using in global bindings

Message:

   The following issue has been closed.

   Resolver: Jochen Wiedmann
       Date: Wed, 11 Aug 2004 5:26 PM

The NPE is fixed. The binding of xs:int to Integer is simply ignored,
though, which is possibly another bug report worth.

However, if javaType were currently supported, it still wouldn't solve
your issue: IMO the binding to a custom java type can only work, if the requested type is a subclass of the default type. Thus, an implementation would simply refuse your schema, because Integer is
of course no subclass of int.

IMO a possible solution of your issue would go like this:

a) Invent a property ("nullable.types", for example), that requests
   that elements with "minOccurs=0" or attributes with "use=optional"
   be bound to nullable types.
b) Make the primitive type implementations list to that property.

For a), there's not very much to do: Add a property to the
"XJCTask", and make sure, that generator.setProperty() is
invoked. The "package" property is an example of how to do
this.

The b) part is a little bit more complicated. I offer to do that,
if you create a patch for a).

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/JAXME-21

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: JAXME-21
    Summary: NullPointerException when using <jaxb:javaType> in global bindings
       Type: Bug

     Status: Closed
   Priority: Major
 Resolution: FIXED

    Project: JaxMe

   Assignee: 
   Reporter: Matt Magoffin

    Created: Fri, 6 Aug 2004 8:51 AM
    Updated: Wed, 11 Aug 2004 5:26 PM

Description:
When I add the following to a shema, XJC generates a NullPointerException:

<annotation>
  <appinfo>
    <jaxb:globalBindings>
      <jaxb:javaType name="java.lang.Integer" xmlType="xs:int"/>
    </jaxb:globalBindings>
  </appinfo>
</annotation>

(This is using the 0.3 release).



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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