public <T> T executeWithin(ElementHandle element, Callable<T> callable) throws ProcessingException { return executeWithin(element.get(env), callable); }
public Builder addClassPath(Iterable<ReadFileSystem<?>> classPaths) { for (ReadFileSystem<?> classPath : classPaths) { addClassPath(classPath); } return this; }
/** * Resolve a resource for this application. * * @param path the path of the resource to resolve * @return the resolved resource or null if it cannot be determined * @throws NullPointerException if any argument is null * @throws IllegalArgumentException if the context package is not valid */ public FileObject resolveResource(Path.Absolute path) throws NullPointerException, IllegalArgumentException { return model.processingContext.resolveResourceFromSourcePath(handle, path); }
@Test public void testGetResourceFromSourcePath() throws Exception { DiskFileSystem input = diskFS("compiler.getresource"); RAMFileSystem output = new RAMFileSystem(); Compiler compiler = Compiler.builder().javaCompiler(compilerProvider).sourcePath(input).output(output).build(); GetResource processor = new GetResource(StandardLocation.SOURCE_PATH, FileKey.newResourceName("compiler.getresource", "A.txt")); compiler.addAnnotationProcessor(processor); compiler.compile(); assertEquals(1, output.size(ReadFileSystem.FILE)); processor.assertResource("value"); }
final Compiler.Builder builder() { Compiler.Builder builder = Compiler.builder(); builder.javaCompiler(javaCompiler); builder.processor(processorFactory); builder.addClassPath(classPath); builder.sourcePath(sourcePath); builder.sourceOutput(sourceOutput); builder.classOutput(classOutput); builder.config(config); return builder; }
@Test public void testLineTerminator() { Message msg = new Message(TemplateMetaModel.CANNOT_WRITE_APPLICATION, "a\nb"); String s = msg.format(); msg = Message.parse(s); assertNotNull(msg); } }
public void compile() throws IOException, CompilationException { VirtualFileManager fileManager = new VirtualFileManager( javaCompiler.getStandardFileManager(null, null, null), sourcePath, classPaths, sourceOutput, classOutput ); compile(fileManager, getFromSourcePath(fileManager.sourcePath)); }
public AnnotationKey(Element element, Name type) { this.element = ElementHandle.create(element); this.type = type; }
public CompilerAssert<I, O> formalErrorReporting(boolean formalErrorReporting) { if (formalErrorReporting) { strategy.config.withProcessorOption("juzu.error_reporting", "formal"); } else { strategy.config.withProcessorOption("juzu.error_reporting", null); } return this; }
private Method(Name type, String name, ArrayList<String> parameterTypes) { this.type = new Type(type); this.name = name; this.parameterTypes = parameterTypes; }
@Test public void testGetResourceFromSourcePath() throws Exception { DiskFileSystem input = diskFS("compiler.getresource"); RAMFileSystem output = new RAMFileSystem(); Compiler compiler = Compiler.builder().javaCompiler(compilerProvider).sourcePath(input).output(output).build(); GetResource processor = new GetResource(StandardLocation.SOURCE_PATH, FileKey.newResourceName("compiler.getresource", "A.txt")); compiler.addAnnotationProcessor(processor); compiler.compile(); assertEquals(1, output.size(ReadFileSystem.FILE)); processor.assertResource("value"); }
final Compiler.Builder builder() { Compiler.Builder builder = Compiler.builder(); builder.javaCompiler(javaCompiler); builder.processor(processorFactory); builder.addClassPath(classPath); builder.sourcePath(sourcePath); builder.sourceOutput(sourceOutput); builder.classOutput(classOutput); builder.config(config); return builder; }
@Test public void testLineTerminator() { Message msg = new Message(TemplateMetaModel.CANNOT_WRITE_APPLICATION, "a\nb"); String s = msg.format(); msg = Message.parse(s); assertNotNull(msg); } }
/** * Resolve a resource for this application. * * @param path the path of the resource to resolve * @return the resolved resource or null if it cannot be determined * @throws NullPointerException if any argument is null * @throws IllegalArgumentException if the context package is not valid */ public FileObject resolveResource(Path.Absolute path) throws NullPointerException, IllegalArgumentException { return model.processingContext.resolveResourceFromSourcePath(handle, path); }
public void compile() throws IOException, CompilationException { VirtualFileManager fileManager = new VirtualFileManager( javaCompiler.getStandardFileManager(null, null, null), sourcePath, classPaths, sourceOutput, classOutput ); compile(fileManager, getFromSourcePath(fileManager.sourcePath)); }
public <T> T executeWithin(ElementHandle element, Callable<T> callable) throws ProcessingException { return executeWithin(element.get(env), callable); }
public Builder addClassPath(Iterable<ReadFileSystem<?>> classPaths) { for (ReadFileSystem<?> classPath : classPaths) { addClassPath(classPath); } return this; }
public CompilerAssert<I, O> formalErrorReporting(boolean formalErrorReporting) { if (formalErrorReporting) { strategy.config.withProcessorOption("juzu.error_reporting", "formal"); } else { strategy.config.withProcessorOption("juzu.error_reporting", null); } return this; }
private Method(Name type, String name, ArrayList<String> parameterTypes) { this.type = new Type(type); this.name = name; this.parameterTypes = parameterTypes; }