Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornhauge2010-05-12 14:39:14 +0000
committernhauge2010-05-12 14:39:14 +0000
commit56e01d0dca257b9b5b6785f20f85ad0c8f30fd6e (patch)
tree1fbc08f38a379bde0eb97dfd05f57c17ca5bf6e5 /jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen
parent2de5671e51f3b8645b45253384829bba6a6d225d (diff)
downloadwebtools.dali-56e01d0dca257b9b5b6785f20f85ad0c8f30fd6e.tar.gz
webtools.dali-56e01d0dca257b9b5b6785f20f85ad0c8f30fd6e.tar.xz
webtools.dali-56e01d0dca257b9b5b6785f20f85ad0c8f30fd6e.zip
310718 - Generate jaxb.properties file on MOXy schema generation if it doesn't already exist in the project.
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen')
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties2
2 files changed, 6 insertions, 3 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java
index 3576799b41..2438b94bc6 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/Main.java
@@ -13,6 +13,7 @@ import java.io.File;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import javax.xml.bind.JAXBException;
@@ -22,6 +23,7 @@ import javax.xml.transform.stream.StreamResult;
import org.eclipse.jpt.eclipselink.jaxb.core.schemagen.internal.JptEclipseLinkJaxbCoreMessages;
import org.eclipse.persistence.jaxb.JAXBContext;
+import org.eclipse.persistence.jaxb.JAXBContextFactory;
/**
* Generate a EclipseLink JAXB Schema
@@ -92,8 +94,9 @@ public class Main
Class[] sourceClasses = this.buildSourceClasses(this.sourceClassNames, loader);
- jaxbContext = (JAXBContext)JAXBContext.newInstance(sourceClasses);
-
+ //call MOXy JAXBContextFactory directly. This eliminates the need to have the JAXB properties file in place
+ //in time for the generation.
+ jaxbContext = (JAXBContext)JAXBContextFactory.createContext(sourceClasses, Collections.<String,Object>emptyMap());
}
catch (JAXBException ex) {
this.handleJaxbException(ex);
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties
index 047632e98a..f7914dbf32 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/src/org/eclipse/jpt/eclipselink/jaxb/core/schemagen/internal/jpt_eclipselink_jaxb_core.properties
@@ -18,4 +18,4 @@ javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
CONTEXT_FACTORY_NOT_FOUND = \nThe JAXBContextFactory {0} \n\
configured in the jaxb.properties file could not be located on the project classpath. \n\
The JAXB provider that defines this factory should be added to the project classpath, \n\
-or the JAXBContextFactory property should be removed to use the default provider.
+or the jaxb.properties file should be removed to use the default provider.

Back to the top