[jibx-users] precompiled binding problem

2012-02-03 Thread Chris Florian
Hi list,

Using Jibx 1.2.2/jdk 1.6.x. I have a jar of jibx instrumented support 
classes. In a separate jar, I subclass one of the support classes and I 
want to include and extend the mapping for that base class. I added the 
include with precompiled=true and I am including the base jar in the 
classpath of the binding compiler task, but I always seem to get No 
mapping found for class X.

If I only use map-as in the extended binding I get no errors, only if 
I try to use extends in the mapping element.

Is this not allowed or have I completely misunderstood the concept of 
extending a binding?



Thanks.
Chris


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] How to: abstract mappings with interface implementations?

2012-02-03 Thread Dave Schoorl
Thanks. I already was afraid JiBX needs to know which of B or C it's 
unmarshalling at the time it sees the Identifier1 element. 

However, I am looking into creating my own IUnmarshaller implementation that 
will probe the xml to see what implementation class the xml will resolve to. It 
is my goal to make it a general purpose IUnmarshaller. If it leads to anything 
useful, I will post my solution in this thread.

Regards,

Dave


   
On Feb 1, 2012, at 4:56 PM, Archie Cobbs wrote:

 On Wed, Feb 1, 2012 at 9:31 AM, Dave Schoorl wrote:
 Thanks for your reply. Actually, I need mapping for classes B and C to be 
 abstract, because in the xml, I don't know what the containing element will 
 be: it could be either Identifier1 or Identifier2 or to turn it around, in 
 the xml, Identifier1 and Identifier2 could be unmarshalled to either an 
 instance of class B or C, depending on the containing xml structure.
 
 To illustrate this, the following snippets of xml should both be 
 unmarshallable, the first would unmarshal to an instance of class B, the 
 second to an instance of class C.
 
   Identifier1
 LdapName1/LdapName
   /Identifier1
 
   Identifier1
 IdentPart1a/IdentPart1
 IdentPart2b/IdentPart2
   /Identifier1
 
 To my understanding, this can't work, because JiBX needs to know which of A 
 or B it's unmarshalling at the time it sees the Identifier1 element. By the 
 time it recurses and starts decoding the nested elements, it's already chosen 
 which outer concrete binding it is decoding with.
 
 Your only option if the XML can't be changed is to create a single class that 
 contains both of A's and B's fields. You could then add methods to that class 
 that returned an actual instance of A or B as appropriate (by 
 copying/mirroring the field values). This adds an ugly extra step in your 
 Java code but allows this XML to work.
 
 -Archie
 
 -- 
 Archie L. Cobbs

--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] Skip code generation for included XML Schema

2012-02-03 Thread k . claszen
Hi Don,

thanks on your feedback. I will give it a try. As my artifacts are not OSGi enabled I think I first have to take a look how to put the binding.xml in my jar without the use of the maven-bundle-plugin (http://stackoverflow.com/questions/7112198/maven-jibx-codegen-storing-binding-xml might help on this).

I will give feedback when done!

Regards
 Klaus

PS: I know OSGi won't matter but I try to keep things simple to understandSMS schreiben mit WEB.DE FreeMail - einfach, schnell undkostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


Re: [jibx-users] precompiled binding problem

2012-02-03 Thread Chris Florian
From the Jibx src it appears as if a mapping can only extend an 
instance of MappingElement and not a PrecompiledMappingElement 
(model/MappingElement.java).



On 02/03/2012 06:40 AM, Chris Florian wrote:

Hi list,

Using Jibx 1.2.2/jdk 1.6.x. I have a jar of jibx instrumented support
classes. In a separate jar, I subclass one of the support classes and I
want to include and extend the mapping for that base class. I added the
include  with precompiled=true and I am including the base jar in the
classpath of the binding compiler task, but I always seem to get No
mapping found for class X.

If I only use map-as in the extended binding I get no errors, only if
I try to use extends in the mapping element.

Is this not allowed or have I completely misunderstood the concept of
extending a binding?



Thanks.
Chris


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users



--
_ Chris Florian |TXIO Corporation|www.txio.ca http://www.txio.ca | 
1.416.414.6378 _
--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users