Here is one and the generated java source. It would be nice to have it fixed so that I can upgrade without changing code.

thanks

Bill

Werner Guttmann wrote:

Bill, Nick,

Can you please provide us with a short sample XML Schema instance that
highlights the problem ?

Werner

Bill Leng wrote:
It looks to me that it is a bug because if you want a java.lang.Object
you don't need to cast and no code change is needed. This change breaks
the compatiability without gaining anything.

Bill

Neil Taylor wrote:

Hi Bill,
I have run in to this too. Specifically, I have seen this when my
schema is using stuff from xml.xsd and xlink.xsd. An example is
xml:lang and xlink:href.  I think it might be a bug - it is certainly
a change in behaviour - but haven't had time to investigate it nor
file a bug report yet.

Regards,
Neil

On Wednesday, June 22, 2005, at 02:44PM, Bill Leng
<[EMAIL PROTECTED]> wrote:



Hi
We are currently using castor 0.9.5.3 to generate Java source files
from XML schema. When I try to upgrade to the latest castor, I found
the signature of unmarsha method has been changed. It used to return
the specific class type but now it returns java.lang.Object. I am not
sure if this is a bug or not. If it is not a bug, we have to make
many changes to our code to do the cast. Does anyone have the same
problem?

thanks

Bill

-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty
message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------



-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message
to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------


<xsd:schema  xmlns:xsd="http://www.w3.org/2001/XMLSchema"; >
    <xsd:element name="ldoDesc" type="LdoDescType">
    <xsd:annotation>
        <xsd:documentation>XML Schema for an Interchange Platform Loadable Object Description</xsd:documentation>
        <xsd:documentation> - Copyright 2004 Metatomix. All rights reserved.</xsd:documentation>
    </xsd:annotation>
    </xsd:element>
    <xsd:complexType name="LdoDescType">
        <xsd:sequence>
            <xsd:element name="name" type="AlphaNumString"/>
            <xsd:element name="description" type="xsd:string"/>
            <xsd:element name="category" type="CategoryString"/>
            <xsd:element name="default" type="xsd:boolean" minOccurs="0"/>
            <xsd:element name="type" type="TypeString"/>
            <xsd:element name="repositoryUrl" minOccurs="0" type="xsd:anyURI"/>
            <xsd:element name="version" minOccurs="0" type="VersionString"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="AlphaNumString">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"/>
            <xsd:pattern value="[\w\d\- ]+"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="CategoryString">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="SYSTEM"/>
            <xsd:enumeration value="APP"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="DescriptionString">
        <xsd:restriction base="xsd:string">
            <xsd:maxLength value="255"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="TypeString">
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="MANAGER"/>
            <xsd:enumeration value="CONNECTION"/>
            <xsd:enumeration value="PORT"/>
            <xsd:enumeration value="BUS"/>
            <xsd:enumeration value="AGENT"/>
            <xsd:enumeration value="ACCOUNT"/>
            <xsd:enumeration value="COMMENT"/>
            <xsd:enumeration value="EXTERNAL_SYSTEM"/>
            <xsd:enumeration value="MODULAR_PLATFORM_SERVICE"/>
            <xsd:enumeration value="ARTIFACT"/>
            <xsd:enumeration value="SERVICE_PROFILE"/>
        </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="VersionString">
        <xsd:restriction base="xsd:string">
            <xsd:pattern value="[0-9.]*|DEFAULT"/>
        </xsd:restriction>
    </xsd:simpleType>
</xsd:schema>
<!--
====================================================================================
$Header: /opt/dev/src/gs/src/com/geobot/gs/repository/Attic/ldodesc.xsd,v 1.10.4.1 2004/09/08 16:38:36 kyancy Exp $
$Revision: 1.10.4.1 $
====================================================================================
$Log: ldodesc.xsd,v $
Revision 1.10.4.1  2004/09/08 16:38:36  kyancy
Updated xsd:documentation to include description and CVS log


-->
/*
 * This class was automatically generated with 
 * <a href="http://www.castor.org";>Castor 0.9.7</a>, using an XML
 * Schema.
 * $Id$
 */

package com.jdx.ix.rep.castor;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.Marshaller;
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.ValidationException;
import org.xml.sax.ContentHandler;

/**
 * XML Schema for an Interchange Platform Loadable Object
 * Description - Copyright 2004 Metatomix. All rights reserved.
 * 
 * @version $Revision$ $Date$
 */
public class LdoDesc extends LdoDescType 
implements java.io.Serializable
{


      //----------------/
     //- Constructors -/
    //----------------/

    public LdoDesc() 
     {
        super();
    } //-- com.jdx.ix.rep.castor.LdoDesc()


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method isValid
     * 
     * 
     * 
     * @return boolean
     */
    public boolean isValid()
    {
        try {
            validate();
        }
        catch (org.exolab.castor.xml.ValidationException vex) {
            return false;
        }
        return true;
    } //-- boolean isValid() 

    /**
     * Method marshal
     * 
     * 
     * 
     * @param out
     */
    public void marshal(java.io.Writer out)
        throws org.exolab.castor.xml.MarshalException, 
org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, out);
    } //-- void marshal(java.io.Writer) 

    /**
     * Method marshal
     * 
     * 
     * 
     * @param handler
     */
    public void marshal(org.xml.sax.ContentHandler handler)
        throws java.io.IOException, org.exolab.castor.xml.MarshalException, 
org.exolab.castor.xml.ValidationException
    {
        
        Marshaller.marshal(this, handler);
    } //-- void marshal(org.xml.sax.ContentHandler) 

    /**
     * Method unmarshal
     * 
     * 
     * 
     * @param reader
     * @return Object
     */
    public static java.lang.Object unmarshal(java.io.Reader reader)
        throws org.exolab.castor.xml.MarshalException, 
org.exolab.castor.xml.ValidationException
    {
        return (com.jdx.ix.rep.castor.LdoDesc) 
Unmarshaller.unmarshal(com.jdx.ix.rep.castor.LdoDesc.class, reader);
    } //-- java.lang.Object unmarshal(java.io.Reader) 

    /**
     * Method validate
     * 
     */
    public void validate()
        throws org.exolab.castor.xml.ValidationException
    {
        org.exolab.castor.xml.Validator validator = new 
org.exolab.castor.xml.Validator();
        validator.validate(this);
    } //-- void validate() 

}

-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to