users@jaxb.java.net

RE: Unable to honor plugin customizations

From: Burnett, Adam <Adam.Burnett_at_idearc.com>
Date: Thu, 13 Mar 2008 17:38:31 -0400

So I found out my problem. Turns out my plugin was only correctly
picking up the first customization and not the second one.

Victory!

-Adam

-----Original Message-----
From: Burnett, Adam [mailto:Adam.Burnett_at_idearc.com]
Sent: Wednesday, March 12, 2008 2:43 PM
To: users_at_jaxb.dev.java.net
Subject: Unable to honor plugin customizations

I wrote a plugin which looks for <replace> tags in the schema to do some
post processing on the generated classes. It works fine when there is
one <replace> tag but gives the following error when I try and use
multiple tags:

"compiler was unable to honor this mr:replace customization. It is
attached to a wrong place, or its inconsistent with other bindings."

Here is a snippet from my schema (CDATA body excluded for brevity):
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
 xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
 xmlns:mr="http://jaxb2-commons.dev.java.net/plugin/method-replacer"
 targetNamespace="..."
 xmlns="..."
 jxb:version="2.1"
 jxb:extensionBindingPrefixes="mr">
.
.
.
<xs:complexType name="addressInfo">
<xs:annotation><xs:appinfo>
  <mr:replace>
    <name>setLatitude</name>
    <method><![CDATA[ ... ]]></method>
  </mr:replace>

  <mr:replace>
    <name>setLongitude</name>
    <method><![CDATA[ .. ]]></method>
  </mr:replace>
</xs:appinfo></xs:annotation>
<xs:all>
   <xs:element name="latitude" type="xs:string/> ...etc
</xs:complexType>

In my plugin I am calling markAsAcknowledged for each customization.

Would this be caused by how I'm parsing through the customizations in my
plugin or do I have to do something else to enable to me to specify
multiple customizations like this?

-Adam