users@jaxb.java.net

xjc generated classes with bound properties support

From: Marcos <marcos_at_softingsystems.com.br>
Date: Thu, 04 Jan 2007 14:19:23 -0300
Hi all,

I'm new to JAXB and I've run the binding compiler (xjc) against one of mine .xsd files.
One of the generated classes follows.:

public class LoaderJob {

    /**
     * Sets the value of the logMode property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *    
     */
    public void setLogMode(String value) {
        this.logMode = value;
    }

}

Question.: Can the binding compiler be customized in such a way to insert the "...fireXXX" methods ?
           Below the desired result.:

public class LoaderJob {

    /**
     * Sets the value of the logMode property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *    
     */
    public void setLogMode(String logMode) {
        String oldLogMode = this.logMode;       /* Can this customization be perfomed by the binding compiler or another tool ??? */
        this.logMode = logMode;                 /* It's very boring to change each method manually ;-( and takes too much time since I've many classes.*/
        firePropertyChange("logMode", oldLogMode, logMode);

    }

}

Thank you very much
Marcos