/** * @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;
/** * @deprecated Use {@link #setExtendedClass(Class)} instead */ @Deprecated void setExtendedType(@Nullable Class<?> optionalExtendedClass);
/** * Equivalent with {@link #getSubresources(ClassLoader, String, boolean, boolean)} with the <var>recurse</var> * parameter set to {@code true}. */ public static Map<String, URL> getSubresources(@Nullable ClassLoader classLoader, String name, boolean includeDirectories) throws IOException { return ClassLoaders.getSubresources(classLoader, name, includeDirectories, true); }
/** * @deprecated Auxiliary classes never really worked... don't use them. */ @Deprecated public void setParentClassLoader(@Nullable ClassLoader optionalParentClassLoader, Class<?>[] auxiliaryClasses) { this.setParentClassLoader(optionalParentClassLoader); }
@Override public final void cook(@Nullable String optionalFileName, InputStream is) throws CompileException, IOException { this.cook(optionalFileName, is, null); }
/** * Sets the given file name, and the current line number to 1, and the current column number to 1, when the first * {@code char} is read from the <var>reader</var>. */ protected Reader newFileName(@Nullable final String optionalFileName, Reader reader) { return Readers.onFirstChar(reader, new Runnable() { @Override public void run() { ClassBodyEvaluator.this.addOffset(optionalFileName); } }); }
@Override public void report(@Nullable final Diagnostic<? extends JavaFileObject> diagnostic) { assert diagnostic != null; if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { throw new DiagnosticException(diagnostic); } } },