Class AbstractJavaScriptConfiguration

java.lang.Object
org.htmlunit.javascript.configuration.AbstractJavaScriptConfiguration
Direct Known Subclasses:
JavaScriptConfiguration, ProxyAutoConfigJavaScriptConfiguration

public abstract class AbstractJavaScriptConfiguration extends Object
An abstract container for all the JavaScript configuration information.
  • Field Details

  • Constructor Details

    • AbstractJavaScriptConfiguration

      protected AbstractJavaScriptConfiguration(BrowserVersion browser)
      Constructor.
      Parameters:
      browser - the browser version to use
  • Method Details

    • getClasses

      protected abstract Class<? extends HtmlUnitScriptable>[] getClasses()
      Returns:
      the classes configured by this configuration
    • getAll

      public Iterable<ClassConfiguration> getAll()
      Gets all the configurations.
      Returns:
      the class configurations
    • getClassConfiguration

      public static ClassConfiguration getClassConfiguration(Class<? extends HtmlUnitScriptable> klass, BrowserVersion browserVersion)
      Returns the class configuration of the given klass.
      Parameters:
      klass - the class
      browserVersion - the browser version
      Returns:
      the class configuration
    • process

      private static void process(ClassConfiguration classConfiguration, SupportedBrowser expectedBrowser)
    • isSupported

      private static boolean isSupported(SupportedBrowser[] browsers, SupportedBrowser expectedBrowser)
    • isCompatible

      public static boolean isCompatible(SupportedBrowser browser1, SupportedBrowser browser2)
      Returns whether the two SupportedBrowser are compatible or not.
      Parameters:
      browser1 - the first SupportedBrowser
      browser2 - the second SupportedBrowser
      Returns:
      whether the two SupportedBrowser are compatible or not
    • getClassConfiguration

      public ClassConfiguration getClassConfiguration(String hostClassName)
      Gets the class configuration for the supplied JavaScript class name.
      Parameters:
      hostClassName - the JavaScript class name
      Returns:
      the class configuration for the supplied JavaScript class name
    • getDomJavaScriptMappingFor

      public Class<? extends HtmlUnitScriptable> getDomJavaScriptMappingFor(Class<?> clazz)
      Returns an immutable map containing the DOM to JavaScript mappings. Keys are java classes for the various DOM classes (e.g. HtmlInput.class) and the values are the JavaScript class names (e.g. "HTMLAnchorElement").
      Parameters:
      clazz - the class to get the scriptable for
      Returns:
      the mappings