Class JavaxPacScriptParser
- java.lang.Object
-
- com.github.markusbernhardt.proxy.selector.pac.JavaxPacScriptParser
-
- All Implemented Interfaces:
PacScriptParser
public class JavaxPacScriptParser extends Object implements PacScriptParser
PAC parser using the Rhino JavaScript engine bundled with Java 1.6
More information about PAC can be found there:
Proxy_auto-config
web-browser-auto-proxy-configuration- Author:
- Markus Bernhardt, Copyright 2016, Bernd Rosstauscher, Copyright 2009
-
-
Constructor Summary
Constructors Constructor Description JavaxPacScriptParser(PacScriptSource source)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringevaluate(String url, String host)Evaluates the given URL and host against the PAC script.PacScriptSourcegetScriptSource()Gets the source of the PAC script used by this parser.
-
-
-
Constructor Detail
-
JavaxPacScriptParser
public JavaxPacScriptParser(PacScriptSource source) throws ProxyEvaluationException
Constructor- Parameters:
source- the source for the PAC script.- Throws:
ProxyEvaluationException- on error.
-
-
Method Detail
-
getScriptSource
public PacScriptSource getScriptSource()
Gets the source of the PAC script used by this parser.- Specified by:
getScriptSourcein interfacePacScriptParser- Returns:
- a PacScriptSource.
-
evaluate
public String evaluate(String url, String host) throws ProxyEvaluationException
Evaluates the given URL and host against the PAC script.- Specified by:
evaluatein interfacePacScriptParser- Parameters:
url- the URL to evaluate.host- the host name part of the URL.- Returns:
- the script result.
- Throws:
ProxyEvaluationException- on execution error.
-
-