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 classClass used to contain the constant information name, value and flag.static classClass 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 Stringprivate List<ClassConfiguration.ConstantInfo> private final Class<?>[]private final Stringprivate final Class<? extends HtmlUnitScriptable> private final StringThe constructor method in thehostClass_private Stringprivate final booleanprivate 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 TypeMethodDescriptionvoidaddConstant(String name, Object value) Add the constant to the configuration.voidaddFunction(String name, Method method) Add the function to the configuration.voidaddProperty(String name, Method getter, Method setter) Add the property to the configuration.voidaddStaticFunction(String name, Method method) Add the static function to the configuration.voidaddStaticProperty(String name, Method getter, Method setter) Add the static property to the configuration.voidAdd the symbol to the configuration.voidaddSymbolConstant(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) voidsetJSConstructor(String name, Member jsConstructor) (package private) voidsetJSConstructorAlias(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
-
addStaticProperty
-
addConstant
-
getPropertyMap
Returns the Map of entries for the defined properties.- Returns:
- the map
-
getSymbolMap
-
getSymbolConstantMap
-
getStaticPropertyMap
Returns the set of entries for the defined static properties.- Returns:
- a set
-
getFunctionMap
-
getStaticFunctionMap
-
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
-
addStaticFunction
-
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
-
isJsObject
public boolean isJsObject()- Returns:
- the jsObject
-
getClassName
-