Hi Jacob, I thought of something a little more flexible: maybe by extending the generated class and passing an instance of this new class as a seed to a factory. Either way, I think we're stuck with an old version of xml beans.
thanks, Pieter 2007/6/25, Jacob Danner <[EMAIL PROTECTED]>:
Hi Pieter, You should be able to use this via the extension mechanism avaiable with version 2.2 and later. Here is the blurb from teh release: Extensions - You can now add custom functionality to generated XMLBeans. You can pass to the Schema Compiler 1) an interface that defines the set of methods to implement and 2) a static handler that implements this functionality. The generated classes will implement the interface and, for each method, call out to the static handler. I found teh following references online in case you needed more information: http://wiki.apache.org/xmlbeans/ExtensionInterfacesFeature http://dev2dev.bea.com/pub/a/2004/05/XMLBeans_raj.html http://dev2dev.bea.com/pub/a/2004/11/Configuring_XMLBeans.html Best of luck, -Jacob Danner On 6/25/07, Pieter Cogghe <[EMAIL PROTECTED]> wrote: > Hi, > > I want to add some functionality to the generated classes, without touching > the generated classes themselve. > > Let say I've got a generated class Instrument and I extend it: > > MyInstrument extends Instrument{ > > // dummy method > public String identify(){ > return "MyInstrument"; > } > > } > > Now I want the factory to use this class > > InstrumentDocument.Factory.parse(new File("xxx.xml ")); > > Due to my limited knowledge of XML beans and Java I've no idea how to > accomplish this. > > thanks, > > Pieter > > -- > Pieter Cogghe > Ganzendries 186 > 9000 Gent > 0487 10 14 21 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Pieter Cogghe Ganzendries 186 9000 Gent 0487 10 14 21

