[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-user
Subject:    RE: inheritance: I m I allowed to
From:       Ben Jelloul Marouane <m.benjelloul () nki ! nl>
Date:       2006-05-02 15:41:43
Message-ID: 1146584503.21718.109.camel () spar ! nki ! nl
[Download RAW message or body]

I have one MyInterface and one MyInterfaceHandler but I use it twice(for
each complexType) and there is a problem.

I found another post with the same problem in 2006-01-20 21:58:13 .

I will try to check and put a bug if needed.

Thanks

On Tue, 2006-05-02 at 15:25, Cezar Andrei wrote:
> Is by any chance one complex schema type extending the other? If not it
> should work, or it's a bug. In this case, will you file it in JIRA with
> the repro files?
> 
> Cezar
> 
> > -----Original Message-----
> > From: Ben Jelloul Marouane [mailto:m.benjelloul@nki.nl]
> > Sent: Tuesday, May 02, 2006 3:51 AM
> > To: xmlbeans user mailing list
> > Subject: RE: inheritance: I m I allowed to
> > subClassanXmlMyGeneratedObjectImpl
> > 
> > I tried the ExtensionInterfacesFeature But I reach this problem:
> > (info so you do not get lost: I added prefix Xml in schema.xsdconf)
> > 
> > if in my schema.xsd (and schema.xsdconf) 1 of my complexTypes extends
> > MyInterface
> >  It Works OK.
> > 
> > But if in my schema.xsd I have 2 complexTypes and I want that both
> extends
> >  IAdapter then when a generate the second time (using schema.xsdconf
> with
> > interface)
> >  XmlHolderType extends IAdaptable
> >  XmlHolderTypeLib extends IAdaptable
> > 
> > I have this error:
> > > error: Colliding methods 'getAdapter(java.lang.Class)' in interfaces
> > org.myhandler.IAdaptableHandler and org.myhandler.IAdaptableHandler
> > 
> > And yes it is twice the same object org.myhandler.IAdaptableHandler
> and
> > org.myhandler.IAdaptableHandler.
> > 
> > And the Handler IAdaptableHandler is used twice in schema.xsdconf.
> > Is it the problem ?
> > Here is my schema.xsdconf
> > -------------
> > <xb:config
> xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
> > 	<xb:namespace uri="##any">
> > 		<xb:prefix>Xml</xb:prefix>
> > 	</xb:namespace>
> > 
> > 	<xb:extension for="org.eclipsage.xtecan.XmlHolderTypeLib">
> > 		<xb:interface
> name="org.eclipse.core.runtime.IAdaptable">
> > 
> >
> <xb:staticHandler>org.myhandler.IAdaptableHandler</xb:staticHandler>
> > 		</xb:interface>
> > 	</xb:extension>
> > 	<xb:extension for="org.eclipsage.xtecan.XmlHolderType">
> > 		<xb:interface
> name="org.eclipse.core.runtime.IAdaptable">
> > 
> >
> <xb:staticHandler>org.myhandler.IAdaptableHandler</xb:staticHandler>
> > 		</xb:interface>
> > 	</xb:extension>
> > </xb:config>
> > --------------
> > do you think it can be a bug ?
> > 
> > Other discussion: you say
> > In the early days of XMLBeans we implemented something very similar to
> > what you describe, but it was failing to work when schema types where
> > using inheritance.
> > but if I can create an instance of whatever class (that extends
> BaseImpl
> > or extends someclass that extends BaseImpl),
> > then I can add whatever to that class and my xmlBeans Interfaces does
> not
> > need to inherit at all.
> > 
> > Thanks for the answers.
> > Marouane
> > 
> > On Mon, 2006-05-01 at 21:03, Cezar Andrei wrote:
> > > In the early days of XMLBeans we implemented something very similar
> to
> > > what you describe, but it was failing to work when schema types
> where
> > > using inheritance.
> > >
> > > The solution implemented today even if less nice, is working in
> those
> > > cases and allows the runtime to use the memory more efficiently when
> > > extensions are both used or not.
> > >
> > > Another option, which I don't recommend since I think is way worse
> than
> > > using extensions - but you might want to consider it, is to generate
> the
> > > sources and than explicitly modify and package them.
> > >
> > > Cezar
> > >
> > > > -----Original Message-----
> > > > From: Ben Jelloul Marouane [mailto:m.benjelloul@nki.nl]
> > > > Sent: Monday, May 01, 2006 11:06 AM
> > > > To: xmlbeans user mailing list
> > > > Subject: RE: inheritance: I m I allowed to subClass
> > > > anXmlMyGeneratedObjectImpl
> > > >
> > > > Thanks for the link But still some questions remains.
> > > >
> > > > I m playing with ExtensionInterfacesFeature it but it is not very
> user
> > > > friendly
> > > >  because of the FooHandler that must have a static methode
> > > foo(xmlObject
> > > > xo, String s).
> > > >  and also because every code change means regenerate
> > > > XmlBeanGeneratedInterface.
> > > >
> > > > What I m looking for would lot more easy to handle:
> > > > I want to do something like this.
> > > > XmlBeanGeneratedInterface.Factory.parse(file, MyClass)
> > > > that would return an instance of MyClass (of course MyClass
> extends
> > > The
> > > > class XmlBeanGeneratedInterfaceImpl)
> > > > For the case described before it would be:
> > > > XmlHolderTypeLib.Factory.parse(file, HolderTypeLib)
> > > > that would return an instance of HolderTypeLib.
> > > >
> > > > And then whatever I add to HolderTypeLib I will not need to
> regenerate
> > > > xmlBeans interface.
> > > > Or even if I subclass it again (HolderTypeLibSub extends
> > > HolderTypeLib)
> > > > I want to be able to do also XmlHolderTypeLib.Factory.parse(file,
> > > > HolderTypeLibSub)
> > > >
> > > >
> > > > Does someone have an idea, I m sure it should be possible.
> > > > If some of the developer of xmlBeans see this can you tell me if
> there
> > > > is a chance to do that (or not at all).
> > > >
> > > > Thanks,
> > > > Marouane
> > > >
> > > > On Fri, 2006-04-28 at 18:51, Cezar Andrei wrote:
> > > > > Ben,
> > > > >
> > > > > Take a look at extensions, it's probably what you're looking
> for:
> > > > > http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature
> > > > >
> > > > > Cezar
> > > > >
> > > > > > -----Original Message-----
> > > > > > From: Ben Jelloul Marouane [mailto:m.benjelloul@nki.nl]
> > > > > > Sent: Friday, April 28, 2006 7:32 AM
> > > > > > To: xmlbeans user mailing list
> > > > > > Subject: inheritance: I m I allowed to subClass an
> > > > > > XmlMyGeneratedObjectImpl
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > my problem is this:
> > > > > > I have a generated with scomp:
> > > > > >  Public Interface XmlHolderTypeLib
> > > > > >  Public Class XmlHolderTypeLibImpl
> > > > > > 	extends
> org.apache.xmlbeans.impl.values.XmlComplexContentImpl
> > > > > > 	implements HolderTypeLib
> > > > > >
> > > > > > I need a Class HolderTypeLib that I can load with an xml file
> > > > > > but that have also a lot of other methods that I will add.
> > > > > > The problem is that the XmlHolderTypeLib.Factory.parse(file)
> > > > > >  will create a instance of XmlHolderTypeLibImpl.
> > > > > >
> > > > > > Is it correct to do (I m not sure because XmlHolderTypeLibImpl
> is
> > > in
> > > > > an
> > > > > > impl package):
> > > > > > Class HolderTypeLib extends XmlHolderTypeLibImpl
> > > > > > and even if it is correct how I will create an instance of
> > > > > HolderTypeLib.
> > > > > >
> > > > > > Thanks,
> > > > > > Marouane
> > > > > >
> > > > > >
> > > > > >
> > >
> ---------------------------------------------------------------------
> > > > > > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> > > > > > For additional commands, e-mail: user-help@xmlbeans.apache.org
> > > > >
> > > > >
> > >
> _______________________________________________________________________
> > > > > 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-unsubscribe@xmlbeans.apache.org
> > > > > For additional commands, e-mail: user-help@xmlbeans.apache.org
> > > > >
> > > >
> > > >
> > > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> > > > For additional commands, e-mail: user-help@xmlbeans.apache.org
> > >
> > >
> _______________________________________________________________________
> > > 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-unsubscribe@xmlbeans.apache.org
> > > For additional commands, e-mail: user-help@xmlbeans.apache.org
> > >
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> > For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> _______________________________________________________________________
> 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-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic