Class CompileSpec.Builder<T extends ScriptOrFn<T>,U extends CompileSpec.Builder<T,U>>

java.lang.Object
org.htmlunit.corejs.javascript.CompileSpec.Builder<T,U>
Direct Known Subclasses:
FunctionCompileSpec.Builder, ScriptCompileSpec.Builder
Enclosing class:
CompileSpec<T extends ScriptOrFn<T>>

public abstract static class CompileSpec.Builder<T extends ScriptOrFn<T>,U extends CompileSpec.Builder<T,U>> extends Object
  • Field Details

    • source

      protected final String source
    • sourceName

      protected String sourceName
    • lineno

      protected int lineno
    • securityDomain

      protected Object securityDomain
    • compiler

      protected Evaluator compiler
    • compilationErrorReporter

      protected ErrorReporter compilationErrorReporter
    • compilerEnvironsProcessor

      protected Consumer<CompilerEnvirons> compilerEnvironsProcessor
    • sourceMapper

      protected SourceMapper sourceMapper
    • sourceCodeSupplier

      protected SourceCodeSupplier sourceCodeSupplier
  • Constructor Details

    • Builder

      protected Builder(String source)
  • Method Details

    • sourceName

      public U sourceName(String sourceName)
    • lineno

      public U lineno(int lineno)
    • securityDomain

      public U securityDomain(Object securityDomain)
    • compiler

      public U compiler(Evaluator compiler)
    • compilationErrorReporter

      public U compilationErrorReporter(ErrorReporter compilationErrorReporter)
    • compilerEnvironsProcessor

      public U compilerEnvironsProcessor(Consumer<CompilerEnvirons> compilerEnvironsProcessor)
    • sourceMapper

      public U sourceMapper(SourceMapper sourceMapper)
    • sourceCodeSupplier

      public U sourceCodeSupplier(SourceCodeSupplier sourceCodeSupplier)
      Can be used to set a lazy source code provider for the script being compiled - for example, something that will lookup the script from a database. If set, Rhino will avoid storing the encoded source code and thus save memory. The trade-off is, of course, that whenever someone does `Function.toString()` we will need to do a database lookup.
    • getThis

      protected abstract U getThis()
    • build

      public abstract CompileSpec<T> build()