Class ClassConfiguration


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

      • symbolMap_

        private java.util.Map<org.htmlunit.corejs.javascript.Symbol,​java.lang.reflect.Method> symbolMap_
      • symbolConstantMap_

        private java.util.Map<org.htmlunit.corejs.javascript.Symbol,​java.lang.String> symbolConstantMap_
      • functionMap_

        private java.util.Map<java.lang.String,​java.lang.reflect.Method> functionMap_
      • staticFunctionMap_

        private java.util.Map<java.lang.String,​java.lang.reflect.Method> staticFunctionMap_
      • extendedClassName_

        private final java.lang.String extendedClassName_
      • hostClassSimpleName_

        private final java.lang.String hostClassSimpleName_
      • jsConstructor_

        private java.util.Map.Entry<java.lang.String,​java.lang.reflect.Member> jsConstructor_
        The constructor method in the hostClass_
      • jsConstructorAlias_

        private java.lang.String jsConstructorAlias_
      • domClasses_

        private final java.lang.Class<?>[] domClasses_
      • jsObject_

        private final boolean jsObject_
      • className_

        private final java.lang.String className_
    • Constructor Detail

      • ClassConfiguration

        public ClassConfiguration​(java.lang.Class<? extends HtmlUnitScriptable> hostClass,
                                  java.lang.Class<?>[] domClasses,
                                  boolean jsObject,
                                  java.lang.String className,
                                  java.lang.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

      • setJSConstructor

        void setJSConstructor​(java.lang.String name,
                              java.lang.reflect.Member jsConstructor)
      • setJSConstructorAlias

        void setJSConstructorAlias​(java.lang.String alias)
      • addProperty

        public void addProperty​(java.lang.String name,
                                java.lang.reflect.Method getter,
                                java.lang.reflect.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​(java.lang.String name,
                                      java.lang.reflect.Method getter,
                                      java.lang.reflect.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​(java.lang.String name,
                                java.lang.Object value)
        Add the constant to the configuration.
        Parameters:
        name - Name of the constant
        value - Value of the constant
      • getPropertyMap

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

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

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

        public java.util.Map<java.lang.String,​ClassConfiguration.PropertyInfo> getStaticPropertyMap()
        Returns the set of entries for the defined static properties.
        Returns:
        a set
      • getFunctionMap

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

        public java.util.Map<java.lang.String,​java.lang.reflect.Method> getStaticFunctionMap()
        Returns the set of entries for the defined static functions.
        Returns:
        a set
      • addSymbol

        public void addSymbol​(org.htmlunit.corejs.javascript.Symbol symbol,
                              java.lang.reflect.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,
                                      java.lang.String value)
        Add the symbol to the configuration.
        Parameters:
        symbol - the symbol
        value - the method
      • addFunction

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

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

        public java.lang.String getExtendedClassName()
        Returns:
        the extendedClass
      • getHostClass

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

        public java.lang.String getHostClassSimpleName()
        Returns:
        the hostClassSimpleName
      • getJsConstructor

        public java.util.Map.Entry<java.lang.String,​java.lang.reflect.Member> getJsConstructor()
        Gets the JavaScript constructor method in getHostClass().
        Returns:
        the JavaScript constructor method in getHostClass()
      • getJsConstructorAlias

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

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

        public boolean isJsObject()
        Returns:
        the jsObject
      • getClassName

        public java.lang.String getClassName()
        Returns the class name.
        Returns:
        the class name