You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by ojasrege <oj...@yahoo.com> on 2007/07/31 22:21:16 UTC

adding data members and methods to generated classes that will not produce XML

I want to use XMLBeans XMLObject for a project, but for the classes generated
by XMLBeans,  I want to add some additional data members and methods to
handle program state that I do not want to have written out to an XML
document.

I have been using .NET's system.xml.XmlParser class, and it provides this
sort of capability.

In looking at the code produced by XMLObject, it looks possible.

Question: Does anyone have any thoughts on the best way to accomplish what I
want to do?  Is there a good design pattern to follow?  

Question: Are there any gotchas in doing this?  The only immediate one I can
think of is that everytime the .java files are regenerated by XMLObject, I
will have to reinsert my data members and methods.

-- 
View this message in context: http://www.nabble.com/adding-data-members-and-methods-to-generated-classes-that-will-not-produce-XML-tf4196225.html#a11934308
Sent from the Xml Beans - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


Re: adding data members and methods to generated classes that will not produce XML

Posted by Jacob Danner <ja...@gmail.com>.
I think what you are asking for is possible via the extension
mechanism in XMLBeans. Its an advanced feature, but isn't too
difficult to use. I think the first place you should go is
http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature

then grab a snapshot of the svn srcs and take a peek at the test code
for this feature.

If you have any further questions on how the feature works, don't
hesitate to post to the list. You may however want to post to
user@xmlbeans.apache.org as thats a more appropriate forum for these
kinds of questions.

Best of luck,
-Jacob Danner


On 7/31/07, ojasrege <oj...@yahoo.com> wrote:
>
> I want to use XMLBeans XMLObject for a project, but for the classes generated
> by XMLBeans,  I want to add some additional data members and methods to
> handle program state that I do not want to have written out to an XML
> document.
>
> I have been using .NET's system.xml.XmlParser class, and it provides this
> sort of capability.
>
> In looking at the code produced by XMLObject, it looks possible.
>
> Question: Does anyone have any thoughts on the best way to accomplish what I
> want to do?  Is there a good design pattern to follow?
>
> Question: Are there any gotchas in doing this?  The only immediate one I can
> think of is that everytime the .java files are regenerated by XMLObject, I
> will have to reinsert my data members and methods.
>
> --
> View this message in context: http://www.nabble.com/adding-data-members-and-methods-to-generated-classes-that-will-not-produce-XML-tf4196225.html#a11934308
> Sent from the Xml Beans - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org