Package javax.tools.JavaFileManager

Examples of javax.tools.JavaFileManager.Location


                if (base.equals(extn))
                    log.warning("proc.suspicious.class.name", name, extn);
            }
        }
        checkNameAndExistence(name, isSourceFile);
        Location loc = (isSourceFile ? SOURCE_OUTPUT : CLASS_OUTPUT);
        JavaFileObject.Kind kind = (isSourceFile ?
                                    JavaFileObject.Kind.SOURCE :
                                    JavaFileObject.Kind.CLASS);

        JavaFileObject fileObject =
View Full Code Here


            documented.add(name);
        }

        JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
        StandardJavaFileManager fm = tool.getStandardFileManager(null, null, null);
        Location jarLocation = StandardLocation.locationFor(jarName);
        File jarFile = new File(jarName);
        fm.setLocation(jarLocation, List.of(jarFile));
        fm.setLocation(StandardLocation.CLASS_PATH, List.<File>nil());
        fm.setLocation(StandardLocation.SOURCE_PATH, List.<File>nil());
        {
View Full Code Here

        boolean hasFiles = false;
        docenv.notice("main.Loading_source_files_for_package", name);

        if (files == null) {
            Location location = docenv.fileManager.hasLocation(StandardLocation.SOURCE_PATH)
                    ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH;
            ListBuffer<JavaFileObject> lb = new ListBuffer<JavaFileObject>();
            for (JavaFileObject fo: docenv.fileManager.list(
                    location, name, EnumSet.of(JavaFileObject.Kind.SOURCE), false)) {
                String binaryName = docenv.fileManager.inferBinaryName(location, fo);
View Full Code Here

    /* Helper method that returns a resource file writer for the file having the
     * indicated name and package. */
    private PrintWriter _getResourceWriter(String name, String pkg) {
        Filer filer = _pe.getFiler();
        Element[] siblings = null;
        Location loc = StandardLocation.CLASS_OUTPUT;

        try {
            return _getWriter(filer.createResource(loc, pkg, name, siblings), ASCII_ENCODING);
        } catch (IOException ex) {
            String msg = _i18n.record(Kind.ERROR, CANNOT_OPEN_BUNDLE);
View Full Code Here

    private String readSource(ClassFile cf) {
        if (fileManager == null)
            return null;

        Location location;
        if (fileManager.hasLocation((StandardLocation.SOURCE_PATH)))
            location = StandardLocation.SOURCE_PATH;
        else
            location = StandardLocation.CLASS_PATH;
View Full Code Here

    public PackageDoc containingPackage() {
        PackageDocImpl p = env.getPackageDoc(tsym.packge());
        if (p.setDocPath == false) {
            FileObject docPath;
            try {
                Location location = env.fileManager.hasLocation(StandardLocation.SOURCE_PATH)
                    ? StandardLocation.SOURCE_PATH : StandardLocation.CLASS_PATH;

                docPath = env.fileManager.getFileForInput(
                        location, p.qualifiedName(), "package.html");
            } catch (IOException e) {
View Full Code Here

            classes.add(in);
            task = compiler.getTask(null, filer, diag, options, null, classes);
            task.setProcessors(processors);

            if (task.call() && !diag.hasErrors()) {
                Location loc = StandardLocation.CLASS_OUTPUT;
                String ext = Kind.SOURCE.extension;
                ClassLoader loader = filer.getClassLoader(loc);
                String path = in.toUri().getPath();
                String data = in.getCharContent(true).toString();
                String line;
View Full Code Here

  return createSourceOrClassFile(false, name.toString());
    }

    private JavaFileObject createSourceOrClassFile(boolean isSourceFile, String name) throws IOException {
        checkNameAndExistence(name, isSourceFile);
  Location loc = (isSourceFile ? SOURCE_OUTPUT : CLASS_OUTPUT);
  JavaFileObject.Kind kind = (isSourceFile ?
            JavaFileObject.Kind.SOURCE :
            JavaFileObject.Kind.CLASS);

        JavaFileObject fileObject =
View Full Code Here

TOP

Related Classes of javax.tools.JavaFileManager.Location

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.