No replies yet ... should I have asked or searched somewhere else?


Daniel Kastenholz schrieb:
Hi,

I have just started using JAXB/JaxMe and am somewhat confused about the so-called "Fail-Fast" feature. My understanding is that, by enabling it with something like

--BEGIN--

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; targetNamespace="http://mynamespace"; xmlns="http://mynamespace"; xmlns:jxb="http://java.sun.com/xml/ns/jaxb"; jxb:version="2.0">

  <xs:annotation>
    <xs:appinfo>
      <jxb:globalBindings enableFailFastCheck="1"/>
    </xs:appinfo>
  </xs:annotation>

--END--

the produced source files should be able to detect invalid value assignments at runtime. But I don't get it working. I have made some test restrictions in a DTD like

--BEGIN--

  <xs:simpleType name="TestType">
    <xs:restriction base="xs:int">
      <xs:minInclusive value="0"/>
      <xs:maxInclusive value="5000"/>
    </xs:restriction>
  </xs:simpleType>


--END--

and

--BEGIN--

  <xs:complexType name="Gebaeude" abstract="true">
    ...
    <xs:sequence>
      <xs:element name="deg">
        <xs:simpleType>
          <xs:restriction base="xs:decimal">
            <xs:minInclusive value="0"/>
            <xs:maxExclusive value="90"/>
          </xs:restriction>
        </xs:simpleType>
</xs:element> </xs:sequence>
  </xs:complexType>

--END--

but I can still assign values out of range to the corresponding objects at runtime and nothing happens. According to the documentation, an exception or some kind of error handling should instead be triggered.

(I have noticed that Sun have apparently not implemented this feature in their JAXB reference version yet, but I found no information that neither does JaxMe.)

Any suggestions?

Thanks in advance!


--Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  • "Fail-Fast"?! Daniel Kastenholz
    • Re: "Fail-Fast"?! Daniel Kastenholz

Reply via email to