Package javax.tools

Examples of javax.tools.JavaFileObject.toUri()


     *
     */
    private PrintWriter createSourceFile(String originalClass, String metaClass, TypeElement e)
        throws IOException {
        JavaFileObject javaFile = processingEnv.getFiler().createSourceFile(metaClass, e);
        logger.info(_loc.get("mmg-process", javaFile.toUri().normalize()));
        return new PrintWriter(javaFile.openWriter());
    }
   
    /**
     * Get the value for the given keys, whoever matches first, in the current available options.
View Full Code Here


     *
     */
    private PrintWriter createSourceFile(String originalClass, String metaClass, TypeElement e)
        throws IOException {
        JavaFileObject javaFile = processingEnv.getFiler().createSourceFile(metaClass, e);
        logger.info(_loc.get("mmg-process", javaFile.toUri().normalize()));
        return new PrintWriter(javaFile.openWriter());
    }
   
    /**
     * Get the value for the given keys, whoever matches first, in the current available options.
View Full Code Here

     *
     */
    private PrintWriter createSourceFile(String originalClass, String metaClass, TypeElement e)
        throws IOException {
        JavaFileObject javaFile = processingEnv.getFiler().createSourceFile(metaClass, e);
        logger.info(_loc.get("mmg-process", javaFile.toUri().normalize()));
        return new PrintWriter(javaFile.openWriter());
    }
   
    /**
     * Get the value for the given keys, whoever matches first, in the current available options.
View Full Code Here

        File path = test_src.getCanonicalFile();
        File src = new File(new File(path, "."), "T6440333.java");
        JavaFileObject fo = fm.getJavaFileObjects(src).iterator().next();
        URI expect = src.getCanonicalFile().toURI();
        System.err.println("Expect " + expect);
        System.err.println("Found  " + fo.toUri());
        if (!expect.equals(fo.toUri())) {
            throw new AssertionError();
        }
    }
    public static void main(String... args) throws IOException {
View Full Code Here

        File src = new File(new File(path, "."), "T6440333.java");
        JavaFileObject fo = fm.getJavaFileObjects(src).iterator().next();
        URI expect = src.getCanonicalFile().toURI();
        System.err.println("Expect " + expect);
        System.err.println("Found  " + fo.toUri());
        if (!expect.equals(fo.toUri())) {
            throw new AssertionError();
        }
    }
    public static void main(String... args) throws IOException {
        new T6440333().test(args);
View Full Code Here

            setSourceOutputDirectory(OutputPath.getAbsoluteDirectory(processingEnv, e));
        }
        JavaFileObject javaFile = fileManager.getJavaFileForOutput(StandardLocation.SOURCE_OUTPUT,
            metaClass, JavaFileObject.Kind.SOURCE,
            null); // do not use sibling hint because of indeterminable behavior across JDK
        logger.info(_loc.get("mmg-process", javaFile.toUri()));
        OutputStream out = javaFile.openOutputStream();
        PrintWriter writer = new PrintWriter(out);
        return writer;
    }
   
View Full Code Here

               
                // JavaFileObject f = unit.getSourceFile();
                JavaFileObject f = (JavaFileObject)unit.getClass().getMethod("getSourceFile", (Class[])null)
                    .invoke(unit, (Object[])null);
               
                URI uri = f.toUri();
                File dir = getParentFile(new File(uri.toURL().getPath()),
                        packageDepth(e.getQualifiedName().toString()));
                return dir;
            } catch (Throwable t) {
                return null;
View Full Code Here

        System.err.println("Expect " + expect);
        // CURRENTLY, the following line fails on Windows because a file C:/w/jjg/...
        // returns a URI file://C/w/jjg... which incorrectly encodes the drive letter
        // in the URI authority.   This is against the spec that the authority is
        // undefined and breaks the contract that new File(f.toURI()).equals(f.getAbsoluteFile())
        System.err.println("Got: " +  fo.toUri().getPath());
        if (!expect.equals(fo.toUri().getPath())) {
            throw new AssertionError();
        }
    }
    public static void main(String... args) throws IOException {
View Full Code Here

        // CURRENTLY, the following line fails on Windows because a file C:/w/jjg/...
        // returns a URI file://C/w/jjg... which incorrectly encodes the drive letter
        // in the URI authority.   This is against the spec that the authority is
        // undefined and breaks the contract that new File(f.toURI()).equals(f.getAbsoluteFile())
        System.err.println("Got: " +  fo.toUri().getPath());
        if (!expect.equals(fo.toUri().getPath())) {
            throw new AssertionError();
        }
    }
    public static void main(String... args) throws IOException {
        new T6440333().test(args);
View Full Code Here

      myContext.processMessage(new ProgressMessage("Compiled " + fileObject.getFile().getPath()));

      final JavaFileObject source = fileObject.getSource();
      if (source != null) {
        final File file = new File(source.toUri());
        synchronized (mySuccessfullyCompiled) {
          mySuccessfullyCompiled.add(file);
        }
      }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.