List Info

Thread: RE: copy constructor for inherited types?




RE: copy constructor for inherited types?
user name
2007-09-27 09:56:05
Like in java, using only XMLObject's typed methods you have
to set each
field.

But if you use XMLCursor API (which is not typed) you can
copy or even
better (performance wise) move content from a to b.

Cezar

> -----Original Message-----
> From: Stefan Lischke [mailto:s.lischkezertificon.com]
> Sent: Thursday, September 27, 2007 4:09 AM
> To: userxmlbeans.apache.org
> Subject: copy constructor for inherited types?
> 
> hi there,
> 
> I have to xsd types. Type A and B. B extends A and adds
another
element.
> 
> In source i have an instance of A and want to create a
new instance of
B
> from A.
> 
> Any ideas? something like B.Factory.newInstance(A) for
example? or do
i
> have to copy all fields by myself?
> 
> I tried with B.set(A) but B gets orphaned after this
and i cannot set
> the value of the extended Element of B
> 
> thanx in advance
> 
> Stefan

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: user-unsubscribexmlbeans.apache.org
For additional commands, e-mail: user-helpxmlbeans.apache.org


[1]

about | contact  Other archives ( Real Estate discussion Medical topics )