Java Code Examples for com.sun.codemodel.internal.JPackage#addResourceFile()
The following examples show how to use
com.sun.codemodel.internal.JPackage#addResourceFile() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeanGenerator.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public JClass generateStaticClass(Class src, JPackage out) { String shortName = getShortName(src.getName()); // some people didn't like our jars to contain files with .java extension, // so when we build jars, we'' use ".java_". But when we run from the workspace, // we want the original source code to be used, so we check both here. // see bug 6211503. URL res = src.getResource(shortName + ".java"); if (res == null) { res = src.getResource(shortName + ".java_"); } if (res == null) { throw new InternalError("Unable to load source code of " + src.getName() + " as a resource"); } JStaticJavaFile sjf = new JStaticJavaFile(out, shortName, res, null); out.addResourceFile(sjf); return sjf.getJClass(); }
Example 2
Source File: BeanGenerator.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public JClass generateStaticClass(Class src, JPackage out) { String shortName = getShortName(src.getName()); // some people didn't like our jars to contain files with .java extension, // so when we build jars, we'' use ".java_". But when we run from the workspace, // we want the original source code to be used, so we check both here. // see bug 6211503. URL res = src.getResource(shortName + ".java"); if (res == null) { res = src.getResource(shortName + ".java_"); } if (res == null) { throw new InternalError("Unable to load source code of " + src.getName() + " as a resource"); } JStaticJavaFile sjf = new JStaticJavaFile(out, shortName, res, null); out.addResourceFile(sjf); return sjf.getJClass(); }
Example 3
Source File: BeanGenerator.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public JClass generateStaticClass(Class src, JPackage out) { String shortName = getShortName(src.getName()); // some people didn't like our jars to contain files with .java extension, // so when we build jars, we'' use ".java_". But when we run from the workspace, // we want the original source code to be used, so we check both here. // see bug 6211503. URL res = src.getResource(shortName + ".java"); if (res == null) { res = src.getResource(shortName + ".java_"); } if (res == null) { throw new InternalError("Unable to load source code of " + src.getName() + " as a resource"); } JStaticJavaFile sjf = new JStaticJavaFile(out, shortName, res, null); out.addResourceFile(sjf); return sjf.getJClass(); }
Example 4
Source File: BeanGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public JClass generateStaticClass(Class src, JPackage out) { String shortName = getShortName(src.getName()); // some people didn't like our jars to contain files with .java extension, // so when we build jars, we'' use ".java_". But when we run from the workspace, // we want the original source code to be used, so we check both here. // see bug 6211503. URL res = src.getResource(shortName + ".java"); if (res == null) { res = src.getResource(shortName + ".java_"); } if (res == null) { throw new InternalError("Unable to load source code of " + src.getName() + " as a resource"); } JStaticJavaFile sjf = new JStaticJavaFile(out, shortName, res, null); out.addResourceFile(sjf); return sjf.getJClass(); }
Example 5
Source File: BeanGenerator.java From hottub with GNU General Public License v2.0 | 6 votes |
public JClass generateStaticClass(Class src, JPackage out) { String shortName = getShortName(src.getName()); // some people didn't like our jars to contain files with .java extension, // so when we build jars, we'' use ".java_". But when we run from the workspace, // we want the original source code to be used, so we check both here. // see bug 6211503. URL res = src.getResource(shortName + ".java"); if (res == null) { res = src.getResource(shortName + ".java_"); } if (res == null) { throw new InternalError("Unable to load source code of " + src.getName() + " as a resource"); } JStaticJavaFile sjf = new JStaticJavaFile(out, shortName, res, null); out.addResourceFile(sjf); return sjf.getJClass(); }
Example 6
Source File: BeanGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public JClass generateStaticClass(Class src, JPackage out) { String shortName = getShortName(src.getName()); // some people didn't like our jars to contain files with .java extension, // so when we build jars, we'' use ".java_". But when we run from the workspace, // we want the original source code to be used, so we check both here. // see bug 6211503. URL res = src.getResource(shortName + ".java"); if (res == null) { res = src.getResource(shortName + ".java_"); } if (res == null) { throw new InternalError("Unable to load source code of " + src.getName() + " as a resource"); } JStaticJavaFile sjf = new JStaticJavaFile(out, shortName, res, null); out.addResourceFile(sjf); return sjf.getJClass(); }
Example 7
Source File: BeanGenerator.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public JClass generateStaticClass(Class src, JPackage out) { String shortName = getShortName(src.getName()); // some people didn't like our jars to contain files with .java extension, // so when we build jars, we'' use ".java_". But when we run from the workspace, // we want the original source code to be used, so we check both here. // see bug 6211503. URL res = src.getResource(shortName + ".java"); if (res == null) { res = src.getResource(shortName + ".java_"); } if (res == null) { throw new InternalError("Unable to load source code of " + src.getName() + " as a resource"); } JStaticJavaFile sjf = new JStaticJavaFile(out, shortName, res, null); out.addResourceFile(sjf); return sjf.getJClass(); }
Example 8
Source File: PrivateObjectFactoryGenerator.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
Example 9
Source File: PrivateObjectFactoryGenerator.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
Example 10
Source File: PrivateObjectFactoryGenerator.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
Example 11
Source File: PrivateObjectFactoryGenerator.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
Example 12
Source File: PrivateObjectFactoryGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
Example 13
Source File: PrivateObjectFactoryGenerator.java From hottub with GNU General Public License v2.0 | 5 votes |
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
Example 14
Source File: PrivateObjectFactoryGenerator.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
Example 15
Source File: PrivateObjectFactoryGenerator.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public PrivateObjectFactoryGenerator(BeanGenerator outline, Model model, JPackage targetPackage) { super(outline, model, targetPackage.subPackage("impl")); JPackage implPkg = targetPackage.subPackage("impl"); // put JAXBContextFactory into the impl package JClass factory = outline.generateStaticClass(JAXBContextFactory.class,implPkg); // and then put jaxb.properties to point to it JPropertyFile jaxbProperties = new JPropertyFile("jaxb.properties"); targetPackage.addResourceFile(jaxbProperties); jaxbProperties.add( JAXBContext.JAXB_CONTEXT_FACTORY, factory.fullName()); }
Example 16
Source File: BeanGenerator.java From openjdk-jdk9 with GNU General Public License v2.0 | 4 votes |
public JClass generateStaticClass(Class src, JPackage out) { JStaticJavaFile sjf = new JStaticJavaFile(out, getShortName(src), src, null); out.addResourceFile(sjf); return sjf.getJClass(); }