users@jaxb.java.net

how to throw exception in methods of extended classes

From: Jean-Marie Condom <jmc_at_meteorage.com>
Date: Wed, 08 Feb 2006 10:37:55 +0100

Hello

I extend a generated class (AreaCircle) in the following way :

<xsd:complexType name="AreaCircle">
  <xsd:annotation>
    <xsd:appinfo>
      <jaxb:class
        implClass="alerte.alertedataextend.AreaCircleEx" />
    </xsd:appinfo>
  </xsd:annotation>
  <xsd:sequence>
    <xsd:element name="PointLatLong" type="PointLatLong"/>
  </xsd:sequence>
  <xsd:attribute name="ray" type="xsd:float"/>
  <xsd:attribute name="surface" type="xsd:float"/>
</xsd:complexType>

the following method is generated by JAXB in AreaCircleImpl.java :

    public void setPointLatLong(alerte.alertedata.PointLatLong value) {
        _PointLatLong = value;
    }

 i would like now to re-write setPointLatLong in AreaCircleEx and throw
an exception as follows :

public class AreaCircleEx extends AreaCircleImpl {
...
public void setPointLatLong(alerte.alertedata.PointLatLong value) throws
Exception {
        ....
}
...
}

but Java doesn't agree with this since setPointLatLong of generated
class AreaCircleImpl doesn't throw any exception ;
how can i solve this pb ?

thanks in advance

Jean-Marie