JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.javascript.configuration

Class ClassConfiguration



  • public final class ClassConfiguration
    extends Object 
    A container for all the JavaScript configuration information for one class.
    Author:
    Mike Bowler, Chris Erskine, Ahmed Ashour, Ronald Brill
    • Constructor Detail

      • ClassConfiguration

        public ClassConfiguration(Class<? extends HtmlUnitScriptable> hostClass,
         Class<?>[] domClasses,
         boolean jsObject,
         String className,
         String extendedClassName)
        Constructor.
        Parameters:
        hostClass - - the class implementing this functionality
        domClasses - the DOM classes that this object supports
        jsObject - boolean flag for if this object is a JavaScript object
        className - the class name, can be null
        extendedClassName - the extended class name
    • Method Detail

      • addProperty

        public void addProperty(String name,
         Method getter,
         Method setter)
        Add the property to the configuration.
        Parameters:
        name - name of the property
        getter - the getter method
        setter - the setter method
      • addStaticProperty

        public void addStaticProperty(String name,
         Method getter,
         Method setter)
        Add the static property to the configuration.
        Parameters:
        name - name of the static property
        getter - the static getter method
        setter - the static setter method
      • addConstant

        public void addConstant(String name,
         Object value)
        Add the constant to the configuration.
        Parameters:
        name - Name of the constant
        value - Value of the constant
      • getFunctionMap

        public Map<String,Method> getFunctionMap()
        Returns the set of entries for the defined functions.
        Returns:
        a set
      • getStaticFunctionMap

        public Map<String,Method> getStaticFunctionMap()
        Returns the set of entries for the defined static functions.
        Returns:
        a set
      • addFunction

        public void addFunction(String name,
         Method method)
        Add the function to the configuration.
        Parameters:
        name - the method name
        method - the method
      • addStaticFunction

        public void addStaticFunction(String name,
         Method method)
        Add the static function to the configuration.
        Parameters:
        name - the function name
        method - the method
      • getExtendedClassName

        public String getExtendedClassName()
        Returns:
        the extendedClass
      • getHostClass

        public Class<? extends HtmlUnitScriptable> getHostClass()
        Gets the class of the JavaScript host object.
        Returns:
        the class of the JavaScript host object
      • getHostClassSimpleName

        public String getHostClassSimpleName()
        Returns:
        the hostClassSimpleName
      • getJsConstructorAlias

        public String getJsConstructorAlias()
        Returns:
        the JavaScript constructor method alias or null if there is nothing.
      • getDomClasses

        public Class<?>[] getDomClasses()
        Returns the DOM classes.
        Returns:
        the DOM classes
      • isJsObject

        public boolean isJsObject()
        Returns:
        the jsObject
      • getClassName

        public String getClassName()
        Returns the class name.
        Returns:
        the class name
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /