0

I'm trying to enhance a module from using JaxB to JiBX. I was able to produce the java classes through the jiBX maven plugin in pom.xml although I'm having issues on how I can generate an Objectfactory just like the one in JaxB's. Is there like a counterpart in JiBX because I've been searching through the net for hours but I can't find one. I'm new to marshalling and unmarshalling mechanisms so any help will be much appreciated. Thanks!

Rocky
  • 429
  • 1
  • 9
  • 26

1 Answers1

0

Rocky,

JiBX has a similar mechanism. You need to create a JiBX Binding Factory then create a Marshalling or Marshalling context. The best way to see this is to look at one of our examples. Here's a link to a simple program that creates a java object, marshalls it to XML, then unmarshals the XML back to java objects.

https://github.com/jibx/maven-plugin/blob/master/test-suite/base-binding-test/org.jibx.schema.test.person/src/main/java/org/jibx/schema/test/person/PersonTest.java

Enjoy!

Don

Don Corley
  • 496
  • 2
  • 7
  • Hello Don, thank you for this. Although do you have a sample that can be applicable to multiple classes/objects? – Rocky Feb 13 '20 at 05:12
  • Rocky, Sure. Here's an example that creates classes in different packages from modular schema: http://jibx.sourceforge.net/maven-jibx-plugin/modular-codegen.html. There are several additional examples in the documentation. – Don Corley Feb 14 '20 at 06:12