JAXBWrapper is 

JAXB can generate, or marshal, XML from Java objects, and vice versa.
This is accomplished in one of two ways:

1)	Annotating Java classes with appropriate tags allows JAXB to
	translate to and from xml. The head of the XML tree should be
	annotated with @XmlRootElement, children @XmlElement, attributes
	@XmlAttribute. So, for example:
	
	package jaxbexample;
	
	@XmlRootElement
	public class Odontocetes {
		String genus;
		String species;
		
		public String getGenus(){
			return genus;
			}
		
		@XmlElement
		public void setGenus(String genus){
		this.genus = genus;
		}
		
		public String getSpecies(){
			return species;
		}
		
		@XmlElement
		public void setSpecies(String species){
		this.species = species;
		}
		
		
	An explanation of more annotations can be found here:
	https://jaxb.java.net/tutorial/
	
	
	Once the values of an Odontocete() are set, JAXB output will look
	something like this:
	
	<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
	<Odontocetes>
   		<species>Macrocephalus</species>
    	<genus>Physeter</genus>
	</Odontocetes>

	Further, JAXB can unmarshal from XML back into Java
	(assuming we input that same XML file we just generated):
	
	Odontocetes [species=Macrocephalus, genus=Physeter]
	
	
2)	If instead you are starting from an XML oriented project, you may
	not have any java classes to annotate at all. Included in the JAXB
	API is an XML Binding compiler called xjc. xjc can be run from the
    command line and will read an XML schema, then generate classes for
    all elements listed within the schema. This provides the user with
    everything necessary to convert to and from XML/Java, but relies on
    an XML schema.

	From dbxmlServer Readme.txt:
	To build Java bindings for XML schema with JAXB, make sure that 
	the Jax binding compiler (xjc) is on the system path.
	
	Example where $JavaClientSrc maps to the source directory in the
	dbxmlJavaClient project and $Schema maps to the schema directory:
	
	example:
	JavaClientSrc=c:/Users/mroch/Documents/eclipse/dbxmlJavaClient/src
	Schema=c:/Users/mroch/Documents/eclipse/dbxmlServer/Tethys/metadata/lib/schema
	cd $Schema
	xjc -d $JavaClientSrc *.xsd 
	
	This creates a Java package containing classes for every element listed
	within the schema, with proper JAXB annotations.
	
	It looks like a jaxb.index file is required as well.  It can be
	generated as follows:
	cd $Schema
	[Removed many lines this code generated...faulty]
	[index file needs only class names, not schema names., also objectfactory.class replaces need for index file
	automatically generated by xjc]
	ls *.xsd | sed 's/\..*//' >$JavaClientSrc/jaxb.index
	
	


Three Steps to Marshal Objects (in Java)

Prerequisites:
Java 1.6 (Includes JAXB 2.0)
import javax.xml.bind.*;

1)	Context
	To marshal using JAXB, one must first create a reference to a
	JAXBContext object, which tells the runtime which class(es) to look
	to to build XML, e.g.

	JAXBContext context = JAXBContext.newInstance(Detections.class);
	//Alternatively, one can enter entire package(s) Strings separated by colons:
	JAXBContext context = JAXBContext.newInstance("edu.sdsu.tethys.schema._1:edu.sdsu.tethys.schema._2");

	Obviously, these classes must contain the JAXB annotations as 
	described above. When generating classes with xjc, simply supplying
	the generated package name should suffice. 

2)	Marshaller
	Next, a marshaller must be created from the context object we just instantiated:
	Marshaller marshaller = context.createMarshaller();
	
	This marshaller can be set with certain Properties, as so:
	
	mashaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
	
	From Java documentation:
   "This property controls whether or not the Marshaller will format the resulting
	XML data with line breaks and indentation. A true value for this property 
	indicates human readable indented xml data, while a false value indicates 
	unformatted xml data. The Marshaller will default to false (unformatted) if 
	this property is not specified."
	
	Other supported properties can be found here:
	http://docs.oracle.com/javase/6/docs/api/javax/xml/bind/Marshaller.html#supportedProps
	
3)	Marshal
	Lastly, with the context and marshaller set up, the marshal method can be called
	on the marshaller. Most commonly, it will take two arguments: the first being the
	JAXB object that should be marshaled, and the second is where to marshal it to:
	
	marshaller.marshal(Object, System.out);
	
	will take the values of the object, parse them into formatted XML (if that property
	was set) and display the output on the console.
	
	To marshal into a file, a few more steps should be taken:
	
	java.io.PrintWriter output = null;  
	output = new java.io.PrintWriter("c:\example.xml") //instantiate a PrintWriter, specifying output location
	marshaller.marshal(Object, output);
	
	will take the values of the object, parse them into formatted XML (if that property
	was set) and write it into example.xml located on drive C: .
	
	
	
	
	
Custom Namespaces:

JAXB will generate its own namespaces prefixes in its XML output, named ns1, ns2, etc.
By creating a subclass of NameSpacePrefixMapper	
 
 
 
 
 
 
 
 



