Class ClassConfiguration
- java.lang.Object
-
- org.htmlunit.javascript.configuration.ClassConfiguration
-
public final class ClassConfiguration extends java.lang.ObjectA container for all the JavaScript configuration information for one class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classClassConfiguration.ConstantInfoClass used to contain the constant information name, value and flag.static classClassConfiguration.PropertyInfoClass used to contain the property information if the property is readable, writable and the methods that implement the get and set functions.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringclassName_private java.util.List<ClassConfiguration.ConstantInfo>constants_private java.lang.Class<?>[]domClasses_private java.lang.StringextendedClassName_private java.util.Map<java.lang.String,java.lang.reflect.Method>functionMap_private java.lang.Class<? extends HtmlUnitScriptable>hostClass_private java.lang.StringhostClassSimpleName_private java.util.Map.Entry<java.lang.String,java.lang.reflect.Member>jsConstructor_The constructor method in thehostClass_private java.lang.StringjsConstructorAlias_private booleanjsObject_private java.util.Map<java.lang.String,ClassConfiguration.PropertyInfo>propertyMap_private java.util.Map<java.lang.String,java.lang.reflect.Method>staticFunctionMap_private java.util.Map<java.lang.String,ClassConfiguration.PropertyInfo>staticPropertyMap_private java.util.Map<org.htmlunit.corejs.javascript.Symbol,java.lang.String>symbolConstantMap_private java.util.Map<org.htmlunit.corejs.javascript.Symbol,java.lang.reflect.Method>symbolMap_
-
Constructor Summary
Constructors Constructor Description ClassConfiguration(java.lang.Class<? extends HtmlUnitScriptable> hostClass, java.lang.Class<?>[] domClasses, boolean jsObject, java.lang.String className, java.lang.String extendedClassName)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConstant(java.lang.String name, java.lang.Object value)Add the constant to the configuration.voidaddFunction(java.lang.String name, java.lang.reflect.Method method)Add the function to the configuration.voidaddProperty(java.lang.String name, java.lang.reflect.Method getter, java.lang.reflect.Method setter)Add the property to the configuration.voidaddStaticFunction(java.lang.String name, java.lang.reflect.Method method)Add the static function to the configuration.voidaddStaticProperty(java.lang.String name, java.lang.reflect.Method getter, java.lang.reflect.Method setter)Add the static property to the configuration.voidaddSymbol(org.htmlunit.corejs.javascript.Symbol symbol, java.lang.reflect.Method method)Add the symbol to the configuration.voidaddSymbolConstant(org.htmlunit.corejs.javascript.Symbol symbol, java.lang.String value)Add the symbol to the configuration.java.lang.StringgetClassName()Returns the class name.java.util.List<ClassConfiguration.ConstantInfo>getConstants()Returns the constant list.java.lang.Class<?>[]getDomClasses()Returns the DOM classes.java.lang.StringgetExtendedClassName()java.util.Map<java.lang.String,java.lang.reflect.Method>getFunctionMap()Returns the set of entries for the defined functions.java.lang.Class<? extends HtmlUnitScriptable>getHostClass()Gets the class of the JavaScript host object.java.lang.StringgetHostClassSimpleName()java.util.Map.Entry<java.lang.String,java.lang.reflect.Member>getJsConstructor()Gets the JavaScript constructor method ingetHostClass().java.lang.StringgetJsConstructorAlias()java.util.Map<java.lang.String,ClassConfiguration.PropertyInfo>getPropertyMap()Returns the Map of entries for the defined properties.java.util.Map<java.lang.String,java.lang.reflect.Method>getStaticFunctionMap()Returns the set of entries for the defined static functions.java.util.Map<java.lang.String,ClassConfiguration.PropertyInfo>getStaticPropertyMap()Returns the set of entries for the defined static properties.java.util.Map<org.htmlunit.corejs.javascript.Symbol,java.lang.String>getSymbolConstantMap()Returns the Map of entries for the defined symbols.java.util.Map<org.htmlunit.corejs.javascript.Symbol,java.lang.reflect.Method>getSymbolMap()Returns the Map of entries for the defined symbols.booleanisJsObject()(package private) voidsetJSConstructor(java.lang.String name, java.lang.reflect.Member jsConstructor)(package private) voidsetJSConstructorAlias(java.lang.String alias)
-
-
-
Field Detail
-
propertyMap_
private java.util.Map<java.lang.String,ClassConfiguration.PropertyInfo> propertyMap_
-
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_
-
staticPropertyMap_
private java.util.Map<java.lang.String,ClassConfiguration.PropertyInfo> staticPropertyMap_
-
staticFunctionMap_
private java.util.Map<java.lang.String,java.lang.reflect.Method> staticFunctionMap_
-
constants_
private java.util.List<ClassConfiguration.ConstantInfo> constants_
-
extendedClassName_
private final java.lang.String extendedClassName_
-
hostClass_
private final java.lang.Class<? extends HtmlUnitScriptable> hostClass_
-
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 thehostClass_
-
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 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 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 propertygetter- the getter methodsetter- 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 propertygetter- the static getter methodsetter- 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 constantvalue- 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
-
getConstants
public java.util.List<ClassConfiguration.ConstantInfo> getConstants()
Returns the constant list.- Returns:
- a list
-
addSymbol
public void addSymbol(org.htmlunit.corejs.javascript.Symbol symbol, java.lang.reflect.Method method)Add the symbol to the configuration.- Parameters:
symbol- the symbolmethod- 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 symbolvalue- 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 namemethod- 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 namemethod- 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 ingetHostClass().- 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
-
-