Class JavaxPacScriptParser

  • All Implemented Interfaces:
    PacScriptParser

    public class JavaxPacScriptParser
    extends java.lang.Object
    implements PacScriptParser
    PAC parser using the Rhino JavaScript engine bundled with Java 1.6
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String evaluate​(java.lang.String url, java.lang.String host)
      Evaluates the given URL and host against the PAC script.
      PacScriptSource getScriptSource()
      Gets the source of the PAC script used by this parser.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JavaxPacScriptParser

        public JavaxPacScriptParser​(PacScriptSource source)
                             throws java.lang.Exception
        Constructor
        Parameters:
        source - the source for the PAC script.
        Throws:
        java.lang.Exception - on error.
    • Method Detail

      • evaluate

        public java.lang.String evaluate​(java.lang.String url,
                                         java.lang.String host)
                                  throws java.lang.Exception
        Evaluates the given URL and host against the PAC script.
        Specified by:
        evaluate in interface PacScriptParser
        Parameters:
        url - the URL to evaluate.
        host - the host name part of the URL.
        Returns:
        the script result.
        Throws:
        java.lang.Exception - on execution error.