Java Code Examples for com.sun.codemodel.internal.JPackage#name()

The following examples show how to use com.sun.codemodel.internal.JPackage#name() . 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: SingleStreamCodeWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
    final String name = pkg != null && pkg.name().length() > 0
            ? pkg.name() + '.' + fileName : fileName;

    out.println(
        "-----------------------------------" + name +
        "-----------------------------------");

    return new FilterOutputStream(out) {
        @Override
        public void close() {
            // don't let this stream close
        }
    };
}
 
Example 2
Source File: FilerCodeWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String name;
    if(pkg.isUnnamed())
        name = fileName;
    else
        name = pkg.name()+'.'+fileName;

    name = name.substring(0,name.length()-5);   // strip ".java"

    return filer.createSourceFile(name).openWriter();
}
 
Example 3
Source File: SingleStreamCodeWriter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
    String pkgName = pkg.name();
    if(pkgName.length()!=0)     pkgName += '.';

    out.println(
        "-----------------------------------" + pkgName+fileName +
        "-----------------------------------");

    return new FilterOutputStream(out) {
        public void close() {
            // don't let this stream close
        }
    };
}
 
Example 4
Source File: FilerCodeWriter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String name;
    if(pkg.isUnnamed())
        name = fileName;
    else
        name = pkg.name()+'.'+fileName;

    name = name.substring(0,name.length()-5);   // strip ".java"

    return filer.createSourceFile(name).openWriter();
}
 
Example 5
Source File: FilerCodeWriter.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String tmp = fileName.substring(0, fileName.length()-5);
    if (pkg.name() != null && ! "".equals(pkg.name())) {
            w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter();
    } else {
            w = filer.createSourceFile(tmp).openWriter();
    }
    return w;
}
 
Example 6
Source File: SingleStreamCodeWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
    String pkgName = pkg.name();
    if(pkgName.length()!=0)     pkgName += '.';

    out.println(
        "-----------------------------------" + pkgName+fileName +
        "-----------------------------------");

    return new FilterOutputStream(out) {
        public void close() {
            // don't let this stream close
        }
    };
}
 
Example 7
Source File: FilerCodeWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String name;
    if(pkg.isUnnamed())
        name = fileName;
    else
        name = pkg.name()+'.'+fileName;

    name = name.substring(0,name.length()-5);   // strip ".java"

    return filer.createSourceFile(name).openWriter();
}
 
Example 8
Source File: FilerCodeWriter.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String tmp = fileName.substring(0, fileName.length()-5);
    if (pkg.name() != null && ! "".equals(pkg.name())) {
            w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter();
    } else {
            w = filer.createSourceFile(tmp).openWriter();
    }
    return w;
}
 
Example 9
Source File: FilerCodeWriter.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String tmp = fileName.substring(0, fileName.length()-5);
    if (pkg.name() != null && ! "".equals(pkg.name())) {
            w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter();
    } else {
            w = filer.createSourceFile(tmp).openWriter();
    }
    return w;
}
 
Example 10
Source File: SingleStreamCodeWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
    String pkgName = pkg.name();
    if(pkgName.length()!=0)     pkgName += '.';

    out.println(
        "-----------------------------------" + pkgName+fileName +
        "-----------------------------------");

    return new FilterOutputStream(out) {
        public void close() {
            // don't let this stream close
        }
    };
}
 
Example 11
Source File: FilerCodeWriter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String tmp = fileName.substring(0, fileName.length()-5);
    if (pkg.name() != null && ! "".equals(pkg.name())) {
            w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter();
    } else {
            w = filer.createSourceFile(tmp).openWriter();
    }
    return w;
}
 
Example 12
Source File: FilerCodeWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String tmp = fileName.substring(0, fileName.length()-5);
    if (pkg.name() != null && ! "".equals(pkg.name())) {
            w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter();
    } else {
            w = filer.createSourceFile(tmp).openWriter();
    }
    return w;
}
 
Example 13
Source File: SingleStreamCodeWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
    String pkgName = pkg.name();
    if(pkgName.length()!=0)     pkgName += '.';

    out.println(
        "-----------------------------------" + pkgName+fileName +
        "-----------------------------------");

    return new FilterOutputStream(out) {
        public void close() {
            // don't let this stream close
        }
    };
}
 
Example 14
Source File: FilerCodeWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String name;
    if(pkg.isUnnamed())
        name = fileName;
    else
        name = pkg.name()+'.'+fileName;

    name = name.substring(0,name.length()-5);   // strip ".java"

    return filer.createSourceFile(name).openWriter();
}
 
Example 15
Source File: FilerCodeWriter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String name;
    if(pkg.isUnnamed())
        name = fileName;
    else
        name = pkg.name()+'.'+fileName;

    name = name.substring(0,name.length()-5);   // strip ".java"

    return filer.createSourceFile(name).openWriter();
}
 
Example 16
Source File: SingleStreamCodeWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
    String pkgName = pkg.name();
    if(pkgName.length()!=0)     pkgName += '.';

    out.println(
        "-----------------------------------" + pkgName+fileName +
        "-----------------------------------");

    return new FilterOutputStream(out) {
        public void close() {
            // don't let this stream close
        }
    };
}
 
Example 17
Source File: FilerCodeWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String name;
    if(pkg.isUnnamed())
        name = fileName;
    else
        name = pkg.name()+'.'+fileName;

    name = name.substring(0,name.length()-5);   // strip ".java"

    return filer.createSourceFile(name).openWriter();
}
 
Example 18
Source File: FilerCodeWriter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String tmp = fileName.substring(0, fileName.length()-5);
    if (pkg.name() != null && ! "".equals(pkg.name())) {
            w = filer.createSourceFile(pkg.name() + "." + tmp).openWriter();
    } else {
            w = filer.createSourceFile(tmp).openWriter();
    }
    return w;
}
 
Example 19
Source File: SingleStreamCodeWriter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public OutputStream openBinary(JPackage pkg, String fileName) throws IOException {
    String pkgName = pkg.name();
    if(pkgName.length()!=0)     pkgName += '.';

    out.println(
        "-----------------------------------" + pkgName+fileName +
        "-----------------------------------");

    return new FilterOutputStream(out) {
        public void close() {
            // don't let this stream close
        }
    };
}
 
Example 20
Source File: FilerCodeWriter.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Writer openSource(JPackage pkg, String fileName) throws IOException {
    String name;
    if(pkg.isUnnamed())
        name = fileName;
    else
        name = pkg.name()+'.'+fileName;

    name = name.substring(0,name.length()-5);   // strip ".java"

    return filer.createSourceFile(name).openWriter();
}