RE: @Nullable annotations?
On this point, what are the current annotations that we can use for the generated bean code? Just a pointer to the docs would be perfect, thanks! Schalk -Original Message- From: Willis Morse [mailto:[EMAIL PROTECTED] Sent: 24 November 2007 01:50 PM To: user@xmlbeans.apache.org Subject: @Nullable annotations? This may be a crazy request, but is there any way to get the generated Java code to use the Jetbrains @Nullable annotations? This would allow compile time support for nullability contracts to be driven by the generated code, and not hardcoded into my handbuilt code that uses the generated code. For instance, if I have a complex type that contains an element with minOccurs of 1 and maxOccurs of 1, then the getter for this element could be annotated with @NotNull to provide the contract that the result of this getter will never be null. Likewise, if this element has a minOccurs of 0 and a maxOccurs of 1, then this getter would be annotated with @Nullable to show that the result could be null. In Idea, violation of these contracts show up as red marks in the code editor, and will throw an exception at run time if you don't fix them. As it stands now, my code that uses the generated classes has to always check for a null result, and then decide whether a null result is a valid condition or not based on my knowledge of this portion of the schema. This forces me to hardcode knowledge of the schema into my code. Background: http://www.jetbrains.com/idea/documentation/howto.html Thanks, Willis Morse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Java2WSDL problem
Hi there everyone, I am trying to get some of my XMLBeans pulled through a web service using the WAS Java2WSDL/WSDL2Java tool. Now when it encounters my Impl classes it throws the following error: My generated Impl classes do have a no parameter constructor so this is fine. Does anyone know how to make this work or where I am going wrong? Thanks! [was-java2wsdl] Java2WSDL momentum.wealth.services.contract.ContractHandler [was-java2wsdl] 2007/08/29 16:37:53 com.ibm.ws.webservices.wsdl.fromJava.BeanWriter isBeanCompatible [was-java2wsdl] SEVERE: WSWS3328E: Error: The class momentum.wealth.statement.impl.CessionDtoImpl extends non-bean class org.apache.xmlbeans.impl.values.XmlComplexContentImpl. An xml schema anyType will be used to define momentum.wealth.statement.impl.CessionDtoImpl in the wsdl file. [was-java2wsdl] WSWS3328E: Error: The class momentum.wealth.statement.impl.CessionDtoImpl extends non-bean class org.apache.xmlbeans.impl.values.XmlComplexContentImpl. An xml schema anyType will be used to define momentum.wealth.statement.impl.CessionDtoImpl in the wsdl file. -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
RE: xsdconfig revisited
Thanks Cezar, I got it working late yesterday. From: Cezar Andrei [mailto:[EMAIL PROTECTED] Sent: 27 August 2007 08:18 PM To: user@xmlbeans.apache.org Subject: RE: xsdconfig revisited Check out the wiki page http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature and the tests http://svn.apache.org/viewvc/xmlbeans/trunk/test/cases/xbean/extensions/ interfaceFeature/ As it's described in the wiki page: The for attribute can accept a list of xbean java interfaces (separated by space) or * to include all of them in the extension. This means that momentum.wealth.statement.* is not valid. The handler class has to contain corresponding methods to handle the call of interface methods. Cezar From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: Monday, August 27, 2007 3:22 AM To: user@xmlbeans.apache.org Subject: xsdconfig revisited Greetings All, I have a xsdconfig file named statement.xsdconfig. This file resides in the same directory as all of the XSD's from which my XMLBeans are generated. It contains the following: xb:config xmlns:tns=http://statement.wealth.momentum; xmlns:xb=http://xml.apache.org/xmlbeans/2004/02/xbean/config; xb:extension for=momentum.wealth.statement.* xb:interface name=momentum.wealth.statement.ContractNotesInterface xb:staticHandlermomentum.wealth.statement.ContractNotesInterfaceHandle r/xb:staticHandler /xb:interface /xb:extension /xb:config What I am trying to accomplish is to use the interface extension to get the generated implementation classes to extend and additional interface called ContractNotesInterface. Is the way I am trying to implement this correct in the above code? Should the for contain the package name of the final java source files or the xmlns:tns defined inside the XSD files? What exactly should the staticHandler do? Thanks! -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it.
xsdconfig revisited
Greetings All, I have a xsdconfig file named statement.xsdconfig. This file resides in the same directory as all of the XSD's from which my XMLBeans are generated. It contains the following: xb:config xmlns:tns=http://statement.wealth.momentum; xmlns:xb=http://xml.apache.org/xmlbeans/2004/02/xbean/config; xb:extension for=momentum.wealth.statement.* xb:interface name=momentum.wealth.statement.ContractNotesInterface xb:staticHandlermomentum.wealth.statement.ContractNotesInterfaceHandle r/xb:staticHandler /xb:interface /xb:extension /xb:config What I am trying to accomplish is to use the interface extension to get the generated implementation classes to extend and additional interface called ContractNotesInterface. Is the way I am trying to implement this correct in the above code? Should the for contain the package name of the final java source files or the xmlns:tns defined inside the XSD files? What exactly should the staticHandler do? Thanks! -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
Re: xsdconfig
Hi Cezar, I was just calling it .xsdconfig. So it does need to be for example statement.xsdconfig? I do have it in the same folder as all the XSD's that gets compiled. Thank you for your help so far. Cezar Andrei wrote: Does the file have the xsdconfig extension? I.e. is called somename.xsdconfig? Also make sure it’s in the list of files to be compiled. Cezar *From:* Schalk Neethling [mailto:[EMAIL PROTECTED] *Sent:* Wednesday, August 22, 2007 8:49 AM *To:* user@xmlbeans.apache.org *Subject:* xsdconfig Hey there everyone, I am using the below xsdconfig file in an attempt to get the generated classed to extend an additional Interface momentum.wealth.statement.ContractNotesInterface. I have placed this file in the same directory with all of the .xsd’s I comple from but, this is having no effect on the generated code. I am using the Ant task to generate the XMLBeans. Am I missing something? Thanks for your help! xb:config xmlns:xb=http://xml.apache.org/xmlbeans/2004/02/xbean/config; xb:extension for=momentum.wealth.statement.AddressDto xb:interface name=momentum.wealth.statement.ContractNotesInterface xb:staticHandlermomentum.wealth.statement.ContractNotesInterface/xb:staticHandler /xb:interface /xb:extension /xb:config -- Kind Regards, Schalk Neethling Developer - Momentum Wealth +27 (0) 12 673 7527 This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.12.1/965 - Release Date: 2007/08/21 04:02 PM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Implementation files with empty Constructor
Greetings everyone, Currently when XMLBeans are generated it generates a constructor of the following type for the Impl classes: public AddressDtoImpl(org.apache.xmlbeans.SchemaType sType) { super(sType); } Is there a way to tell it to also generate a no argument constructor? public AddressDtoImpl() { super(); } If this would involve editing the source of XMLBeans can someone please point in the directing of where in the source I should start looking to get this done. Thank you in advance. -- Kind Regards, Schalk Neethling Developer - Momentum Wealth +27 (0) 12 673 7527 This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
XMLBEANS-174
Hey everyone, I have found the feature request to add an empty constructor to the generated Impl XMLBean files on the ASF Jira. Now I see this was assigned to Radu Preotiuc-Pietro but, it seems that there has not been anything done with regards to this feature since 08/Jul/05. I am not sure if the original requester asked for you to replace the current constructor that takes the schema type with an empty constructor but, surely it should not be a problem to generate both a default empty constructor as well as a constructor that takes the schema type as a parameter. I am more then willing to implement this if someone can point me in the right direction with regards to the location in the current code base where the current Constructor is generated. Thank you in advance. -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
RE: General question
Thanks Radu. -Original Message- From: Wing Yew Poon [mailto:[EMAIL PROTECTED] Sent: 17 August 2007 08:01 PM To: user@xmlbeans.apache.org; [EMAIL PROTECTED] Subject: RE: General question From the archives: -- FromRadu Preotiuc-Pietro [EMAIL PROTECTED] Subject RE: Serialization (again) DateWed, 12 Oct 2005 22:53:03 GMT I think the definitive answer is: - generated Java classes are serializable and the serialization format is XML, so that when you deserialize it you can go to parent, to DOM etc, and the behavior will be exactly the same as on the original instance (except for classoading-related things, of course) - the DOM implementation is currently not serializable, I don't really know what the reason for that is. Radu -Original Message- From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: Friday, August 17, 2007 9:44 AM To: user@xmlbeans.apache.org Subject: General question Hey there everyone, A quick question. Is XMLBeans serializable? If so, is there somewhere documentation to confirm this? If not, is there a way to make them serializable? Thanks, Schalk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: General question
Hi there everyone, I thought they had to be serialized. As it is converting XSD(XML) to Java and with the .xmlText method converts it back to XML. From reading the XStream tool docs it made it even more clear, as XStream tool basically does what XMLBeans do. Thanks for the confirmation. Wing Yew Poon wrote: Basically, the generated XMLBeans impl classes extend (eventually) XmlObjectBase, and that implements Serializable: public abstract class XmlObjectBase implements TypeStoreUser, Serializable, XmlObject, SimpleValue You can find the src for XmlObjectBase in src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java in the svn repository. - Wing Yew -Original Message- From: Wing Yew Poon [mailto:[EMAIL PROTECTED] Sent: Friday, August 17, 2007 11:01 AM To: user@xmlbeans.apache.org; [EMAIL PROTECTED] Subject: RE: General question From the archives: -- From Radu Preotiuc-Pietro [EMAIL PROTECTED] Subject RE: Serialization (again) Date Wed, 12 Oct 2005 22:53:03 GMT I think the definitive answer is: - generated Java classes are serializable and the serialization format is XML, so that when you deserialize it you can go to parent, to DOM etc, and the behavior will be exactly the same as on the original instance (except for classoading-related things, of course) - the DOM implementation is currently not serializable, I don't really know what the reason for that is. Radu -Original Message- From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: Friday, August 17, 2007 9:44 AM To: user@xmlbeans.apache.org Subject: General question Hey there everyone, A quick question. Is XMLBeans serializable? If so, is there somewhere documentation to confirm this? If not, is there a way to make them serializable? Thanks, Schalk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. - 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]
Generating Javadoc
Greetings everyone, Is there a way that I can generate Java docs for my own generated XMLBeans? I currently face the situation where a report designer using BIRT is consuming a .jar that contains all of my XMLBeans. The problem is, with BIRT they cannot automatically pick-up the getters on the different XMLBeans so, I have to go and manually create this documentation. Now if I had 10 or even 20 beans that would be ok but when the Ant task is run it is reporting that it compiles 118 DTO's so, this will be a very time consuming exercise. I am hoping that there is a way to get around this. Thanks! -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
RE: Generating Javadoc
Can you accomplish this same task using Ant? From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 10:24 AM To: user@xmlbeans.apache.org Subject: Re: Generating Javadoc The scomp utility has a -src option to generate the Java code. You can run javadoc over this src. -Jacobd On 8/14/07, Schalk Neethling [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greetings everyone, Is there a way that I can generate Java docs for my own generated XMLBeans? I currently face the situation where a report designer using BIRT is consuming a .jar that contains all of my XMLBeans. The problem is, with BIRT they cannot automatically pick-up the getters on the different XMLBeans so, I have to go and manually create this documentation. Now if I had 10 or even 20 beans that would be ok but when the Ant task is run it is reporting that it compiles 118 DTO's so, this will be a very time consuming exercise. I am hoping that there is a way to get around this. Thanks! -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
RE: Generating Javadoc
Just saw the srcgendir on the documentation. I am trying this out now. From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 11:28 AM To: user@xmlbeans.apache.org Subject: RE: Generating Javadoc Can you accomplish this same task using Ant? From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 10:24 AM To: user@xmlbeans.apache.org Subject: Re: Generating Javadoc The scomp utility has a -src option to generate the Java code. You can run javadoc over this src. -Jacobd On 8/14/07, Schalk Neethling [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greetings everyone, Is there a way that I can generate Java docs for my own generated XMLBeans? I currently face the situation where a report designer using BIRT is consuming a .jar that contains all of my XMLBeans. The problem is, with BIRT they cannot automatically pick-up the getters on the different XMLBeans so, I have to go and manually create this documentation. Now if I had 10 or even 20 beans that would be ok but when the Ant task is run it is reporting that it compiles 118 DTO's so, this will be a very time consuming exercise. I am hoping that there is a way to get around this. Thanks! -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
RE: Generating Javadoc
Greetings, Would the appropriate usage of srcgendir be: xmlbean javasource=1.5 destfile=${wealthEngineEar.earContent.dir}/Statement.jar srcgendir=${model.statement.xmlbeans.src} classpath path refid=build.classpath/ path refid=was.classpath/ /classpath fileset dir=${model.src.dir}/momentum/wealth/statement/xsd includes=*.xsd / /xmlbean The reason I am asking is because I just tried this and it did not create any src files in the specified directory. From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 11:38 AM To: user@xmlbeans.apache.org Subject: RE: Generating Javadoc Just saw the srcgendir on the documentation. I am trying this out now. From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 11:28 AM To: user@xmlbeans.apache.org Subject: RE: Generating Javadoc Can you accomplish this same task using Ant? From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 10:24 AM To: user@xmlbeans.apache.org Subject: Re: Generating Javadoc The scomp utility has a -src option to generate the Java code. You can run javadoc over this src. -Jacobd On 8/14/07, Schalk Neethling [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greetings everyone, Is there a way that I can generate Java docs for my own generated XMLBeans? I currently face the situation where a report designer using BIRT is consuming a .jar that contains all of my XMLBeans. The problem is, with BIRT they cannot automatically pick-up the getters on the different XMLBeans so, I have to go and manually create this documentation. Now if I had 10 or even 20 beans that would be ok but when the Ant task is run it is reporting that it compiles 118 DTO's so, this will be a very time consuming exercise. I am hoping that there is a way to get around this. Thanks! -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
RE: Generating Javadoc
No problem, got this working and the javadoc generated from the source. From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 12:01 PM To: user@xmlbeans.apache.org Subject: RE: Generating Javadoc Greetings, Would the appropriate usage of srcgendir be: xmlbean javasource=1.5 destfile=${wealthEngineEar.earContent.dir}/Statement.jar srcgendir=${model.statement.xmlbeans.src} classpath path refid=build.classpath/ path refid=was.classpath/ /classpath fileset dir=${model.src.dir}/momentum/wealth/statement/xsd includes=*.xsd / /xmlbean The reason I am asking is because I just tried this and it did not create any src files in the specified directory. From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 11:38 AM To: user@xmlbeans.apache.org Subject: RE: Generating Javadoc Just saw the srcgendir on the documentation. I am trying this out now. From: Schalk Neethling [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 11:28 AM To: user@xmlbeans.apache.org Subject: RE: Generating Javadoc Can you accomplish this same task using Ant? From: Jacob Danner [mailto:[EMAIL PROTECTED] Sent: 14 August 2007 10:24 AM To: user@xmlbeans.apache.org Subject: Re: Generating Javadoc The scomp utility has a -src option to generate the Java code. You can run javadoc over this src. -Jacobd On 8/14/07, Schalk Neethling [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greetings everyone, Is there a way that I can generate Java docs for my own generated XMLBeans? I currently face the situation where a report designer using BIRT is consuming a .jar that contains all of my XMLBeans. The problem is, with BIRT they cannot automatically pick-up the getters on the different XMLBeans so, I have to go and manually create this documentation. Now if I had 10 or even 20 beans that would be ok but when the Ant task is run it is reporting that it compiles 118 DTO's so, this will be a very time consuming exercise. I am hoping that there is a way to get around this. Thanks! -- Kind Regards, Schalk Neethling This email and all content are subject to the following disclaimer: http://content.momentum.co.za/content/legal/disclaimer_email.htm
Re: sizeOf
Thanks a lot Jacob. Jacob Danner wrote: Hi Schalk, Good question, I had to look into this a little bit :D In answer to your questions: Now my question is what exactly does the sizeOf method return each time it is called? it counts the elements in the store for the array using something like: get_store().count_elements(...); so the result should be the number of items in the array similar to the .length field on an array So am I understanding this correctly? I think so ;) Does this basically allow the Array to grow dynamically as more investment objects are added? Yep, to get into the details of this you will need to understand the xml store and thats a little beyond my knowledge at the moment. In terms I understand, this is required because when maxOccurs=unbounded is in an xsd as an array but the 'unbounded' means there is no 'length' set on the array. This works the same way if maxOccurs=5 but the difference is that if the array length grows greater than 5 it would fail validation. Hope this helps clarify things, please let the list know if you have further questions, -Jacob Danner On 7/24/07, *Schalk Neethling* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greetings everyone, I recently inherited a project from another developer and he was using a lot of XSD's that was converted to XMLBeans via an Ant task. These were then used as schemaDto's. All this is fine and good and I really like the ease of design and automation it brings. One question I have though, in some of the XMLBeans there is a method generated that is something like: sizeOfIvestmentsArray(); Now, he has been using this method as follows: private ContractNotes(ContractNotes cn) { Investments investments = Investments.Factory.newInstance(); this.mapInvestments(investments); cn.addNewInvestments(); cn.setInvestmentsArray(cn.sizeOfInvestmentsArray - 1, investments); return cn; } Now my question is what exactly does the sizeOf method return each time it is called? Does it basically return 1 the first time which would then, used with -1, return index 0 for the Array and then add the investment to this position in the Array. When called again it would return 2, used with -1, it would add the next investment at index 1 within the Array etc. etc. So am I understanding this correctly? Does this basically allow the Array to grow dynamically as more investment objects are added? Looking forward to you input. Kind Regards, Schalk Neethling - To unsubscribe, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.11.8/940 - Release Date: 2007/08/06 04:53 PM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]