Hi,
 
I hope to run generateSource() method twice with javaclassmapping set to "type" and "element" for each time. Following is the code segment. However, even after I set a new value to the javaclassmapping property by using sgen.setDefaultProperties(sg_props), I still get the same javaclassmapping value by sgen.mappingSchemaElement2Java() or sgen.mappingSchemaType2Java(). And the generateSource() program won't run with the new value I set into the property.
 
I'm using castor-0.9.5-xml.jar. Is this a bug or expect behavior? If expected, how can I reset the property value for javaclassmapping and let the generateSource to take the new value?
 
Thanks a lot for your help!
 
Joanna
----------------------------------------------------------------------
            // use generateSource()
            SourceGenerator sgen = new SourceGenerator( new FieldInfoFactory("arraylist") );
                       
            sgen.setDestDir(fileRoot);
            Properties sg_props= sgen.getDefault();
            
            System.out.println("type?="+sgen.mappingSchemaType2Java()+"  element?="+sgen.mappingSchemaElement2Java());
                if (sgen.mappingSchemaType2Java())
                {
                    sg_props.setProperty("org.exolab.castor.builder.javaclassmapping","element");
                }
                if (sgen.mappingSchemaElement2Java())
                {
                    sg_props.setProperty("org.exolab.castor.builder.javaclassmapping","type");
                }
                sgen.setDefaultProperties(sg_props);
               System.out.println("\t\ttype?="+sgen.mappingSchemaType2Java()+"  element?="+sgen.mappingSchemaElement2Java());
          
                sgen.generateSource(xsdPath, packageName);
 
-------------------------------------------------------------------
 
----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to