public FileObject createResource(JavaFileManager.Location location, FileKey key, Element... originatingElements) throws IOException { return createResource(location, key.packageFQN, key.name, originatingElements); }
public FileObject createResource(JavaFileManager.Location location, FileKey key, Element... originatingElements) throws IOException { return createResource(location, key.packageFQN, key.name, originatingElements); }
public FileObject createResource(JavaFileManager.Location location, CharSequence pkg, CharSequence relativeName, Element... originatingElements) throws IOException { return createResource(location, Name.parse(pkg), relativeName, originatingElements); }
public FileObject createResource(JavaFileManager.Location location, CharSequence pkg, CharSequence relativeName, Element... originatingElements) throws IOException { return createResource(location, Name.parse(pkg), relativeName, originatingElements); }
public FileObject createResource(JavaFileManager.Location location, Path.Absolute path, Element... originatingElements) throws IOException { return createResource(location, path.getDirs(), path.getSimpleName(), originatingElements); }
public FileObject createResource(JavaFileManager.Location location, Path.Absolute path, Element... originatingElements) throws IOException { return createResource(location, path.getDirs(), path.getSimpleName(), originatingElements); }
FileObject file = context.createResource(StandardLocation.SOURCE_OUTPUT, "juzu", "processor.log"); out = file.openOutputStream(); if (s != null) {
private boolean _process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws IOException { if (roundEnv.processingOver()) { // Read an existing resource FileObject foo = processingContext.getResource(location, "", "foo.txt"); assertNotNull(foo); String s = Tools.read(foo.openInputStream()); assertEquals("foo_value", s); // Now we overwrite the resource foo = processingContext.createResource(location, "", "foo.txt"); OutputStream out = foo.openOutputStream(); out.write("new_foo_value".getBytes()); out.close(); // Read an non existing resource // JDK 6 strange behavior / bug happens here, we should get bar=null but we don't // JDK 7 should return null FileObject bar = processingContext.getResource(location, "", "bar.txt"); assertNull(bar); // Now create new resource foo = processingContext.createResource(location, "", "juu.txt"); out = foo.openOutputStream(); out.write("juu_value".getBytes()); out.close(); } return true; } }
private boolean _process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws IOException { if (roundEnv.processingOver()) { // Read an existing resource FileObject foo = processingContext.getResource(location, "", "foo.txt"); assertNotNull(foo); String s = Tools.read(foo.openInputStream()); assertEquals("foo_value", s); // Now we overwrite the resource foo = processingContext.createResource(location, "", "foo.txt"); OutputStream out = foo.openOutputStream(); out.write("new_foo_value".getBytes()); out.close(); // Read an non existing resource // JDK 6 strange behavior / bug happens here, we should get bar=null but we don't // JDK 7 should return null FileObject bar = processingContext.getResource(location, "", "bar.txt"); assertNull(bar); // Now create new resource foo = processingContext.createResource(location, "", "juu.txt"); out = foo.openOutputStream(); out.write("juu_value".getBytes()); out.close(); } return true; } }
FileObject dst = context.getResource(StandardLocation.CLASS_OUTPUT, qn, entry.getKey()); if (dst == null || dst.getLastModified() < conn.getLastModified()) { dst = context.createResource(StandardLocation.CLASS_OUTPUT, qn, entry.getKey(), context.get(metaModel.getHandle())); context.info("Copying asset from source path " + src + " to class output " + dst.toUri()); Asset r = bilto.get(entry.getValue());
FileObject dst = context.getResource(StandardLocation.CLASS_OUTPUT, qn, entry.getKey()); if (dst == null || dst.getLastModified() < conn.getLastModified()) { dst = context.createResource(StandardLocation.CLASS_OUTPUT, qn, entry.getKey(), context.get(metaModel.getHandle())); context.info("Copying asset from source path " + src + " to class output " + dst.toUri()); Asset r = bilto.get(entry.getValue());
FileObject file = getContext().createResource(StandardLocation.SOURCE_OUTPUT, "juzu", "metamodel.ser"); out = new ObjectOutputStream(file.openOutputStream()); out.writeObject(state);
FileObject file = getContext().createResource(StandardLocation.SOURCE_OUTPUT, "juzu", "metamodel.ser"); out = new ObjectOutputStream(file.openOutputStream()); out.writeObject(state);
log.info("Resource " + resource + " compiled about to write on disk as " + to); Compilation compilation = (Compilation)result; FileObject fo = env.createResource(StandardLocation.CLASS_OUTPUT, to); Writer writer = fo.openWriter(); try {
Writer writer = null; try { FileObject fo = env.createResource(StandardLocation.CLASS_OUTPUT, "juzu", "config.json"); writer = fo.openWriter(); descriptor.toString(writer, 2);
Writer writer = null; try { FileObject fo = env.createResource(StandardLocation.CLASS_OUTPUT, "juzu", "config.json"); writer = fo.openWriter(); descriptor.toString(writer, 2);
FileObject fo = metaModel.processingContext.createResource(StandardLocation.CLASS_OUTPUT, application.getName(), "config.json"); writer = fo.openWriter(); descriptor.toString(writer, 2);
FileObject fo = metaModel.processingContext.createResource(StandardLocation.CLASS_OUTPUT, application.getName(), "config.json"); writer = fo.openWriter(); descriptor.toString(writer, 2);
@Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { if (count++ == 0) { try { ProcessingContext ctx = new ProcessingContext(processingEnv); ElementHandle.Package pkg = ElementHandle.Package.create(ctx.getPackageElement("compiler.dot.foo")); FileObject file = ctx.resolveResourceFromSourcePath(pkg, FileKey.newName("compiler.dot.foo", "a.b.txt")); InputStream in = file.openInputStream(); FileObject o = ctx.createResource(StandardLocation.CLASS_OUTPUT, FileKey.newName("compiler.dot.foo", "a.b.css")); OutputStream out = o.openOutputStream(); Tools.copy(in, out); Tools.safeClose(in); Tools.safeClose(out); } catch (Exception e) { throw failure(e); } } return true; } });
@Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { if (count++ == 0) { try { ProcessingContext ctx = new ProcessingContext(processingEnv); ElementHandle.Package pkg = ElementHandle.Package.create(ctx.getPackageElement("compiler.dot.foo")); FileObject file = ctx.resolveResourceFromSourcePath(pkg, FileKey.newName("compiler.dot.foo", "a.b.txt")); InputStream in = file.openInputStream(); FileObject o = ctx.createResource(StandardLocation.CLASS_OUTPUT, FileKey.newName("compiler.dot.foo", "a.b.css")); OutputStream out = o.openOutputStream(); Tools.copy(in, out); Tools.safeClose(in); Tools.safeClose(out); } catch (Exception e) { throw failure(e); } } return true; } });