public interface PacScriptEvaluatorFactory
Modifier and Type | Method and Description |
---|---|
PacScriptEvaluator |
createPacScriptEvaluator(String pacSource)
Creates a PAC evaluator based on the given JavaScript source code.
|
PacScriptEvaluator |
getNoOpEvaluator()
Gets a no-op PAC evaluator, meaning one which always returns
Proxy.NO_PROXY
for any call to PacScriptEvaluator.findProxyForURL(java.net.URI) |
PacScriptEvaluator createPacScriptEvaluator(String pacSource) throws PacParsingException
The evaluator must treat the pacSource
as untrusted and evaluate
it in a sandbox.
The method will throw PacParsingException
if the JavaScript input
cannot be parsed/interpreted. In this case you may opt to either do
nothing, report to logging system or use a
no-op evaluator
as an alternative.
pacSource
- The JavaScript source code of the PAC script, as a string.
To be a correct PAC script, it must implement the
FindProxyForURL(url, host)
function. Most often the PAC script
is downloaded from a network location.PacParsingException
- if the source code cannot be parsedPacScriptEvaluator getNoOpEvaluator()
Proxy.NO_PROXY
for any call to PacScriptEvaluator.findProxyForURL(java.net.URI)