Class ClassConfiguration
java.lang.Object
org.htmlunit.javascript.configuration.ClassConfiguration
A container for all the JavaScript configuration information for one class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Class used to contain the constant information name, value and flag.static class
Class used to contain the property information if the property is readable, writable and the methods that implement the get and set functions. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
private List
<ClassConfiguration.ConstantInfo> private final Class<?>[]
private final String
private final Class
<? extends HtmlUnitScriptable> private final String
The constructor method in thehostClass_
private String
private final boolean
private Map
<String, ClassConfiguration.PropertyInfo> private Map
<String, ClassConfiguration.PropertyInfo> -
Constructor Summary
ConstructorsConstructorDescriptionClassConfiguration
(Class<? extends HtmlUnitScriptable> hostClass, Class<?>[] domClasses, boolean jsObject, String className, String extendedClassName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConstant
(String name, Object value) Add the constant to the configuration.void
addFunction
(String name, Method method) Add the function to the configuration.void
addProperty
(String name, Method getter, Method setter) Add the property to the configuration.void
addStaticFunction
(String name, Method method) Add the static function to the configuration.void
addStaticProperty
(String name, Method getter, Method setter) Add the static property to the configuration.void
Add the symbol to the configuration.void
addSymbolConstant
(org.htmlunit.corejs.javascript.Symbol symbol, String value) Add the symbol to the configuration.Returns the class name.Returns the constant list.Class<?>[]
Returns the DOM classes.Returns the set of entries for the defined functions.Class
<? extends HtmlUnitScriptable> Gets the class of the JavaScript host object.Gets the JavaScript constructor method ingetHostClass()
.Returns the Map of entries for the defined properties.Returns the set of entries for the defined static functions.Returns the set of entries for the defined static properties.Returns the Map of entries for the defined symbols.Returns the Map of entries for the defined symbols.boolean
(package private) void
setJSConstructor
(String name, Member jsConstructor) (package private) void
setJSConstructorAlias
(String alias)
-
Field Details
-
propertyMap_
-
symbolMap_
-
symbolConstantMap_
-
functionMap_
-
staticPropertyMap_
-
staticFunctionMap_
-
constants_
-
extendedClassName_
-
hostClass_
-
hostClassSimpleName_
-
jsConstructor_
The constructor method in thehostClass_
-
jsConstructorAlias_
-
domClasses_
-
jsObject_
private final boolean jsObject_ -
className_
-
-
Constructor Details
-
ClassConfiguration
public ClassConfiguration(Class<? extends HtmlUnitScriptable> hostClass, Class<?>[] domClasses, boolean jsObject, String className, String extendedClassName) Constructor.- Parameters:
hostClass
- - the class implementing this functionalitydomClasses
- the DOM classes that this object supportsjsObject
- boolean flag for if this object is a JavaScript objectclassName
- the class name, can be nullextendedClassName
- the extended class name
-
-
Method Details
-
setJSConstructor
-
setJSConstructorAlias
-
addProperty
Add the property to the configuration.- Parameters:
name
- name of the propertygetter
- the getter methodsetter
- the setter method
-
addStaticProperty
Add the static property to the configuration.- Parameters:
name
- name of the static propertygetter
- the static getter methodsetter
- the static setter method
-
addConstant
Add the constant to the configuration.- Parameters:
name
- Name of the constantvalue
- Value of the constant
-
getPropertyMap
Returns the Map of entries for the defined properties.- Returns:
- the map
-
getSymbolMap
Returns the Map of entries for the defined symbols.- Returns:
- the map
-
getSymbolConstantMap
Returns the Map of entries for the defined symbols.- Returns:
- the map
-
getStaticPropertyMap
Returns the set of entries for the defined static properties.- Returns:
- a set
-
getFunctionMap
Returns the set of entries for the defined functions.- Returns:
- a set
-
getStaticFunctionMap
Returns the set of entries for the defined static functions.- Returns:
- a set
-
getConstants
Returns the constant list.- Returns:
- a list
-
addSymbol
Add the symbol to the configuration.- Parameters:
symbol
- the symbolmethod
- the method
-
addSymbolConstant
Add the symbol to the configuration.- Parameters:
symbol
- the symbolvalue
- the method
-
addFunction
Add the function to the configuration.- Parameters:
name
- the method namemethod
- the method
-
addStaticFunction
Add the static function to the configuration.- Parameters:
name
- the function namemethod
- the method
-
getExtendedClassName
- Returns:
- the extendedClass
-
getHostClass
Gets the class of the JavaScript host object.- Returns:
- the class of the JavaScript host object
-
getHostClassSimpleName
- Returns:
- the hostClassSimpleName
-
getJsConstructor
Gets the JavaScript constructor method ingetHostClass()
.- Returns:
- the JavaScript constructor method in
getHostClass()
-
getJsConstructorAlias
- Returns:
- the JavaScript constructor method alias or null if there is nothing.
-
getDomClasses
Returns the DOM classes.- Returns:
- the DOM classes
-
isJsObject
public boolean isJsObject()- Returns:
- the jsObject
-
getClassName
Returns the class name.- Returns:
- the class name
-