Java 类com.sun.codemodel.internal.fmt.JStaticJavaFile 实例源码

项目:OpenJSharp    文件:BeanGenerator.java   
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();
}
项目:lookaside_java-1.8.0-openjdk    文件:BeanGenerator.java   
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();
}
项目:infobip-open-jdk-8    文件:BeanGenerator.java   
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();
}
项目:OLD-OpenJDK8    文件:BeanGenerator.java   
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();
}
项目:openjdk-icedtea7    文件:BeanGenerator.java   
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();
}
项目:openjdk-jdk10    文件:BeanGenerator.java   
public JClass generateStaticClass(Class src, JPackage out) {
    JStaticJavaFile sjf = new JStaticJavaFile(out, getShortName(src), src, null);
    out.addResourceFile(sjf);
    return sjf.getJClass();
}
项目:openjdk9    文件:BeanGenerator.java   
public JClass generateStaticClass(Class src, JPackage out) {
    JStaticJavaFile sjf = new JStaticJavaFile(out, getShortName(src), src, null);
    out.addResourceFile(sjf);
    return sjf.getJClass();
}