You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Patrick Crocker <pa...@gmail.com> on 2008/08/15 22:50:22 UTC

Extension Interfaces without handlers

I'm looking for a way to have a generated XMLBean interface extend an
interface.  At first, I thought that the Extension Interfaces Feature
was what I needed.  However, I have no need to implement the required
static handler.

For example:

public interface MyBean {
  String getName();
  void setName(String name);
}

I want the generated XMLBean interface "MyXmlBean" to extend "MyBean".
 Assuming that the "MyXmlBean" interface was generated with the same
method signatures as the "MyBean" interface based on the xsd,
everything will work out.

This enables my service API to reference the MyBean interface without
having to depend on the generated XMLBeans which, of course, allows me
to replace the XMLBeans implementation with something else if desired.

But... the requirement imposed by the Extension Interface Feature
demands a static handler...  I could write a static handler for the
interface, but this becomes extremely messy when dealing with a large
domain model.

Any hints?

- Patrick Crocker.

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


RE: Extension Interfaces without handlers

Posted by Cezar Andrei <ce...@oracle.com>.
Hi Patrick,

Your scenario isn't a very common one. The only solution that I see here is to modify the generated sources, which first of all we don't recommend/support at all and secondly it's not straight forward to do if you're not familiar with XMLBeans.

Have you thought about using the XMLBeans generated interfaces as your primary interfaces, using .xsdconfig file during compilation gives you control over generated packages and names

Cezar

> -----Original Message-----
> From: Patrick Crocker [mailto:patrick.crocker@gmail.com]
> Sent: Thursday, January 15, 2009 9:01 AM
> To: user@xmlbeans.apache.org
> Subject: Re: Extension Interfaces without handlers
> 
> 
> Anyone have any ideas on this?
> 
> - Patrick.
> 
> 
> 
> Patrick Crocker wrote:
> >
> > I'm looking for a way to have a generated XMLBean interface extend an
> > interface.  At first, I thought that the Extension Interfaces Feature
> > was what I needed.  However, I have no need to implement the required
> > static handler.
> >
> > For example:
> >
> > public interface MyBean {
> >   String getName();
> >   void setName(String name);
> > }
> >
> > I want the generated XMLBean interface "MyXmlBean" to extend "MyBean".
> >  Assuming that the "MyXmlBean" interface was generated with the same
> > method signatures as the "MyBean" interface based on the xsd,
> > everything will work out.
> >
> > This enables my service API to reference the MyBean interface without
> > having to depend on the generated XMLBeans which, of course, allows me
> > to replace the XMLBeans implementation with something else if desired.
> >
> > But... the requirement imposed by the Extension Interface Feature
> > demands a static handler...  I could write a static handler for the
> > interface, but this becomes extremely messy when dealing with a large
> > domain model.
> >
> > Any hints?
> >
> > - Patrick Crocker.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> > For additional commands, e-mail: user-help@xmlbeans.apache.org
> >
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/Extension-Interfaces-
> without-handlers-tp19005369p21479444.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Extension Interfaces without handlers

Posted by Patrick Crocker <pa...@gmail.com>.
Anyone have any ideas on this?

- Patrick.



Patrick Crocker wrote:
> 
> I'm looking for a way to have a generated XMLBean interface extend an
> interface.  At first, I thought that the Extension Interfaces Feature
> was what I needed.  However, I have no need to implement the required
> static handler.
> 
> For example:
> 
> public interface MyBean {
>   String getName();
>   void setName(String name);
> }
> 
> I want the generated XMLBean interface "MyXmlBean" to extend "MyBean".
>  Assuming that the "MyXmlBean" interface was generated with the same
> method signatures as the "MyBean" interface based on the xsd,
> everything will work out.
> 
> This enables my service API to reference the MyBean interface without
> having to depend on the generated XMLBeans which, of course, allows me
> to replace the XMLBeans implementation with something else if desired.
> 
> But... the requirement imposed by the Extension Interface Feature
> demands a static handler...  I could write a static handler for the
> interface, but this becomes extremely messy when dealing with a large
> domain model.
> 
> Any hints?
> 
> - Patrick Crocker.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Extension-Interfaces-without-handlers-tp19005369p21479444.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


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