/** * @see ClassLoader#defineClass(String, byte[], int, int, ProtectionDomain) */ public final void setProtectionDomainFactory(@Nullable ProtectionDomainFactory optionalProtectionDomainFactory) { this.optionalProtectionDomainFactory = optionalProtectionDomainFactory; }
public CompileException(String message, @Nullable Location optionalLocation, Throwable cause) { super(message, optionalLocation, cause); } }
/** * Reads, scans, parses and compiles Java tokens from the given {@link Reader}. * * @param optionalFileName Used when reporting errors and warnings */ void cook(@Nullable String optionalFileName, Reader r) throws CompileException, IOException;
/** * Reads, scans, parses and compiles Java tokens from the given {@link InputStream} with the given {@code * encoding}. */ void cook(InputStream is, @Nullable String optionalEncoding) throws CompileException, IOException;
/** * By default, warnings are discarded, but an application my install a custom {@link WarningHandler}. * * @param optionalWarningHandler {@code null} to indicate that no warnings be issued */ void setWarningHandler(@Nullable WarningHandler optionalWarningHandler); }
/** * @param optionalFileName A human-readable indication where the document related to this {@link Location} can be * found */ public Location(@Nullable String optionalFileName, int lineNumber, int columnNumber) { this.optionalFileName = optionalFileName; this.lineNumber = lineNumber; this.columnNumber = columnNumber; }
/** * Same as {@link #cook(String, String)}, but for multiple scripts. */ void cook(@Nullable String[] optionalFileNames, String[] strings) throws CompileException;
/** * Sets a particular superclass that the generated class will extend. If <var>optionalExtendedClass</var> is {@code * null}, the generated class will extend {@link Object}. * <p> * The usual reason to set a base class for an evaluator is that the generated class can directly access the * superclass's (non-private) members. * </p> */ void setExtendedClass(@Nullable Class<?> optionalExtendedClass);
public LocatedException(String message, @Nullable Location optionalLocation) { super(message); this.optionalLocation = optionalLocation; }
/** * @return The {@link Location} specified at construction time (may be {@code null}) */ @Nullable public Location getLocation() { return this.optionalLocation; } }
/** * Reads, scans, parses and compiles Java tokens from the given {@link InputStream}, encoded * in the "platform default encoding". * * @param optionalFileName Used when reporting errors and warnings */ void cook(@Nullable String optionalFileName, InputStream is) throws CompileException, IOException;
/** * Reads, scans, parses and compiles Java tokens from the given {@link String}. * * @param optionalFileName Used when reporting errors and warnings */ void cook(@Nullable String optionalFileName, String s) throws CompileException;
/** * Reads, scans, parses and compiles Java tokens from the given {@link File} with the given {@code encoding}. */ void cookFile(File file, @Nullable String optionalEncoding) throws CompileException, IOException;
/** * May or may not choose to throw a {@link CompileException}. */ void handleError(String message, @Nullable Location optionalLocation) throws CompileException; }
/** * May or may not choose to throw a {@link CompileException}. * * @param handle A string describing the category of the warning; used for filtering iff non-{@code * null} * @throws CompileException This {@link WarningHandler} wishes to terminate compilation, e.g. because "too many" * warnings have been reported */ void handleWarning(@Nullable String handle, String message, @Nullable Location optionalLocation) throws CompileException; }
/** * Reads, scans, parses and compiles Java tokens from the given {@link InputStream} with the given {@code * encoding}. * * @param optionalFileName Used when reporting errors and warnings */ void cook( @Nullable String optionalFileName, InputStream is, @Nullable String optionalEncoding ) throws CompileException, IOException;
/** * Reads, scans, parses and compiles Java tokens from the named file with the given <var>optionalEncoding</var>. */ void cookFile(String fileName, @Nullable String optionalEncoding) throws CompileException, IOException;
/** * Same as {@link #cook(String, Reader)}, but cooks a <em>set</em> of scripts into one class. Notice that * if <em>any</em> of the scripts causes trouble, the entire compilation will fail. If you * need to report <em>which</em> of the scripts causes the exception, you may want to use the * {@code optionalFileNames} parameter to distinguish between the individual token sources. * <p> * Iff the number of scanners is one, then that single script may contain leading IMPORT directives. * </p>s * * @throws IllegalStateException if any of the preceding {@code set...()} had an array * size different from that of {@code scanners} */ void cook(@Nullable String[] optionalFileNames, Reader[] readers) throws CompileException, IOException;
/** * @param optionalCharacterEncoding if {@code null}, use platform default encoding */ public abstract void setSourceFileCharacterEncoding(@Nullable String optionalCharacterEncoding);