Details
Description
Actually, I just learned myself that what I have said is valid for Java
1.4 and below only. With java 5.0 and baove, this will be possible.
As such, can you please create a new Jira issue, asking us to support this.
Regards
Werner
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.0.0">
<xsd:element name="AKConfig" type="AKConfigType">
<xsd:annotation>
<xsd:documentation>AK Config</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="AKConfigType">
<xsd:sequence>
<xsd:element name="handler" type="xsd:string" />
<xsd:element name="timeout" type="xsd:int" />
<xsd:element name="allowMultiplePartsPerCnxn" type="xsd:boolean" default="false" />
<xsd:element name="CategoryList" type="CategoryListType" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CategoryListType">
<xsd:sequence>
<xsd:element name="CnxnCategory" type="CategoryType" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CategoryType">
<xsd:attribute name="value" type="xsd:string" use="required" />
<xsd:attribute name="MaxConnectionsAllowed" type="xsd:int" use="optional" default="1" />
</xsd:complexType>
</xsd:schema>
In the generated AKConfig.java, the unmarshal() method is:
public static com.ak.castor.AKConfigType unmarshal(
final java.io.Reader reader)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
return (com.ak.castor.AKConfigType) Unmarshaller.unmarshal(com.ak.castor.AKConfig.class, reader);
}
Why does this method return AKConfigType, and not AKConfig?
Even with JDK 1.4, shouldn't the type cast in the return statement be to the subtype?