Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/MOXy/Runtime/Bootstrapping Dynamic/Specifying the EclipseLink Runtime"

m
m (Replacing page with 'See http://www.eclipse.org/eclipselink/documentation/2.4/moxy/dynamic_jaxb002.htm')
 
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{EclipseLink_UserGuide
+
See http://www.eclipse.org/eclipselink/documentation/2.4/moxy/dynamic_jaxb002.htm
|info=y
+
}}
+
==Specifying Dynamic JAXB Bootstrapping in EclipseLink Runtime==
+
 
+
 
+
You can create <tt>JAXBContexts</tt> by specifying a factory class in <tt>jaxb.properties</tt> file and then using the <tt>JAXBContext.newInstance()</tt> API.
+
 
+
#Create a <tt>jaxb.properties</tt>, specifying <tt>DynamicJAXBContextFactory</tt> as the factory used to build new <tt>JAXBContexts</tt>. 
+
#Place the <tt>jaxb.properties</tt> on your classpath within the package in which the <tt>DynamicEntites</tt> will be generated.<div>In this example, the <tt>mynamespace</tt> package will contain the <tt>DynamicEntities</tt>: <br><source lang="java">
+
javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory
+
</source></div>
+
#Use the <tt>newInstance(String contextPath)</tt> method to create a <tt>DynamicJAXBContext</tt>. <br />When this method is called, MOXy attempts to locate a <tt>jaxb.properties</tt> file on the classpath in the package specified by <tt>contextPath</tt>, and use the specified factory.<div><source lang="java">
+
 
+
DynamicJAXBContext jaxbContext = (DynamicJAXBContext) JAXBContext.newInstance("mynamespace");
+
 
+
</source></div>
+
 
+
 
+
 
+
{{EclipseLink_MOXy
+
|next=
+
|previous=
+
|up=
+
|version=2.2.0 - DRAFT}}
+

Latest revision as of 10:36, 8 November 2012

See http://www.eclipse.org/eclipselink/documentation/2.4/moxy/dynamic_jaxb002.htm

Back to the top