Class ClassConfiguration

java.lang.Object
org.htmlunit.javascript.configuration.ClassConfiguration

public final class ClassConfiguration extends Object
A container for all the JavaScript configuration information for one class.
  • Field Details

  • Constructor Details

    • 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 Details

    • setJSConstructor

      void setJSConstructor(String name, Member jsConstructor)
    • setJSConstructorAlias

      void setJSConstructorAlias(String alias)
    • 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
    • getPropertyMap

      public Map<String,ClassConfiguration.PropertyInfo> getPropertyMap()
      Returns the Map of entries for the defined properties.
      Returns:
      the map
    • getSymbolMap

      public Map<org.htmlunit.corejs.javascript.Symbol,Method> getSymbolMap()
      Returns the Map of entries for the defined symbols.
      Returns:
      the map
    • getSymbolConstantMap

      public Map<org.htmlunit.corejs.javascript.Symbol,String> getSymbolConstantMap()
      Returns the Map of entries for the defined symbols.
      Returns:
      the map
    • getStaticPropertyMap

      public Map<String,ClassConfiguration.PropertyInfo> getStaticPropertyMap()
      Returns the set of entries for the defined static properties.
      Returns:
      a set
    • 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
    • getConstants

      public List<ClassConfiguration.ConstantInfo> getConstants()
      Returns the constant list.
      Returns:
      a list
    • addSymbol

      public void addSymbol(org.htmlunit.corejs.javascript.Symbol symbol, Method method)
      Add the symbol to the configuration.
      Parameters:
      symbol - the symbol
      method - the method
    • addSymbolConstant

      public void addSymbolConstant(org.htmlunit.corejs.javascript.Symbol symbol, String value)
      Add the symbol to the configuration.
      Parameters:
      symbol - the symbol
      value - the method
    • 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
    • getJsConstructor

      public Map.Entry<String,Member> getJsConstructor()
      Gets the JavaScript constructor method in getHostClass().
      Returns:
      the JavaScript constructor method in getHostClass()
    • 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