Class AbstractJavaScriptConfiguration
java.lang.Object
org.htmlunit.javascript.configuration.AbstractJavaScriptConfiguration
- Direct Known Subclasses:
JavaScriptConfiguration,ProxyAutoConfigJavaScriptConfiguration
An abstract container for all the JavaScript configuration information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String, ClassConfiguration> private Map<Class<?>, Class<? extends HtmlUnitScriptable>> private static final org.apache.commons.logging.Log -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptiongetAll()Gets all the configurations.static ClassConfigurationgetClassConfiguration(Class<? extends HtmlUnitScriptable> klass, BrowserVersion browserVersion) Returns the class configuration of the givenklass.getClassConfiguration(String hostClassName) Gets the class configuration for the supplied JavaScript class name.protected abstract Class<? extends HtmlUnitScriptable>[]Class<? extends HtmlUnitScriptable> getDomJavaScriptMappingFor(Class<?> clazz) Returns an immutable map containing the DOM to JavaScript mappings.static booleanisCompatible(SupportedBrowser browser1, SupportedBrowser browser2) Returns whether the twoSupportedBrowserare compatible or not.private static booleanisSupported(SupportedBrowser[] browsers, SupportedBrowser expectedBrowser) private static voidprocess(ClassConfiguration classConfiguration, SupportedBrowser expectedBrowser)
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
domJavaScriptMap_
-
configuration_
-
-
Constructor Details
-
AbstractJavaScriptConfiguration
Constructor.- Parameters:
browser- the browser version to use
-
-
Method Details
-
getClasses
- Returns:
- the classes configured by this configuration
-
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 givenklass.- Parameters:
klass- the classbrowserVersion- the browser version- Returns:
- the class configuration
-
process
private static void process(ClassConfiguration classConfiguration, SupportedBrowser expectedBrowser) -
isSupported
-
isCompatible
Returns whether the twoSupportedBrowserare compatible or not.- Parameters:
browser1- the firstSupportedBrowserbrowser2- the secondSupportedBrowser- Returns:
- whether the two
SupportedBrowserare compatible or not
-
getClassConfiguration
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
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
-