/** * Compile a file context. * * @return The compiled result. */ public Output compile(FileContext context, ImportStack importStack) throws CompilationException { NativeFileContext nativeContext = convertToNativeContext(context, importStack); return compileFile(nativeContext); }
/** * Compile a string context. * * @return The compiled result. */ public Output compile(StringContext context, ImportStack importStack) { NativeStringContext nativeContext = convertToNativeContext(context, importStack); return compileString(nativeContext); }
private NativeFileContext convertToNativeContext( FileContext context, ImportStack importStack ) { String inputPath = convertToString(context.getInputPath()); String outputPath = convertToString(context.getOutputPath()); NativeOptions options = convertToNativeOptions(context, importStack); return new NativeFileContext(inputPath, outputPath, options); }
private NativeOptions convertToNativeOptions(Context context, ImportStack importStack) { Options options = context.getOptions(); FunctionWrapper[] functionWrappers = getFunctionWrappers(context, importStack, options); NativeImporterWrapper[] headerImporters = getHeaderImporters(importStack, options); NativeImporterWrapper[] importers = getImporters(importStack, options); boolean sourceMapContents = options.isSourceMapContents(); boolean sourceMapEmbed = options.isSourceMapEmbed(); String sourceMapFile = convertToString(options.getSourceMapFile()); String sourceMapRoot = convertToString(options.getSourceMapRoot());
/** * Compile a string context. * * @param context The string context. * @return The compilation output. * @throws CompilationException If the compilation failed. */ public Output compile(StringContext context) throws CompilationException { final ImportStack importStack = new ImportStack(); return adapter.compile(context, importStack); }
/** * Create new compiler. */ public Compiler() { FunctionArgumentSignatureFactory functionArgumentSignatureFactory = new FunctionArgumentSignatureFactory(); FunctionWrapperFactory functionWrapperFactory = new FunctionWrapperFactory(functionArgumentSignatureFactory); adapter = new NativeAdapter(functionWrapperFactory); }
boolean sourceMapContents = options.isSourceMapContents(); boolean sourceMapEmbed = options.isSourceMapEmbed(); String sourceMapFile = convertToString(options.getSourceMapFile()); String sourceMapRoot = convertToString(options.getSourceMapRoot());
private NativeFileContext convertToNativeContext( FileContext context, ImportStack importStack ) { String inputPath = convertToString(context.getInputPath()); String outputPath = convertToString(context.getOutputPath()); NativeOptions options = convertToNativeOptions(context, importStack); return new NativeFileContext(inputPath, outputPath, options); }
/** * Compile file. * * @param context The file context. * @return The compilation output. * @throws CompilationException If the compilation failed. */ public Output compile(FileContext context) throws CompilationException { final ImportStack importStack = new ImportStack(); return adapter.compile(context, importStack); } }
/** * Create new compiler. */ public Compiler() { FunctionArgumentSignatureFactory functionArgumentSignatureFactory = new FunctionArgumentSignatureFactory(); FunctionWrapperFactory functionWrapperFactory = new FunctionWrapperFactory(functionArgumentSignatureFactory); adapter = new NativeAdapter(functionWrapperFactory); }
private NativeStringContext convertToNativeContext( StringContext context, ImportStack importStack ) { String source = context.getString(); String inputPath = convertToString(context.getInputPath()); String outputPath = convertToString(context.getOutputPath()); NativeOptions options = convertToNativeOptions(context, importStack); return new NativeStringContext(source, inputPath, outputPath, options); }
/** * Compile a file context. * * @return The compiled result. */ public Output compile(FileContext context, ImportStack importStack) { NativeFileContext nativeContext = convertToNativeContext(context, importStack); return compileFile(nativeContext); }
/** * Compile a string context. * * @return The compiled result. */ public Output compile(StringContext context, ImportStack importStack) throws CompilationException { NativeStringContext nativeContext = convertToNativeContext(context, importStack); return compileString(nativeContext); }
/** * Compile file. * * @param context The file context. * @return The compilation output. * @throws CompilationException If the compilation failed. */ public Output compile(FileContext context) throws CompilationException { final ImportStack importStack = new ImportStack(); return adapter.compile(context, importStack); } }
private NativeStringContext convertToNativeContext( StringContext context, ImportStack importStack ) { String source = context.getString(); String inputPath = convertToString(context.getInputPath()); String outputPath = convertToString(context.getOutputPath()); NativeOptions options = convertToNativeOptions(context, importStack); return new NativeStringContext(source, inputPath, outputPath, options); }
/** * Compile a string context. * * @param context The string context. * @return The compilation output. * @throws CompilationException If the compilation failed. */ public Output compile(StringContext context) throws CompilationException { final ImportStack importStack = new ImportStack(); return adapter.compile(context, importStack); }