|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.javascript.configuration.JavaScriptConfiguration
public final class JavaScriptConfiguration
A container for all the JavaScript configuration information. TODO - Need to add the logic to support the browser and JavaScript conditionals in the Class elements.
Field Summary | |
---|---|
static int |
DISABLED
Constant indicating that this function/property is not used by the specified browser version. |
static int |
ENABLED
Constant indicating that this function/property is used by the specified browser version. |
static int |
NOT_FOUND
Constant indicating that this function/property is not defined in the configuration file. |
Method Summary | |
---|---|
protected boolean |
classConfigEquals(String classname,
ClassConfiguration config)
Test to see if the supplied configuration matches for the parsed configuration for the named class This is a method for testing. |
ClassConfiguration |
getClassConfiguration(String classname)
Gets the class configuration for the supplied JavaScript class name. |
protected Class<?> |
getClassObject(String classname)
Returns the class for the given class name. |
Method |
getFunctionMethod(Class<?> clazz,
String functionName)
Gets the method that implements the setter for the given property based upon the class object. |
Method |
getFunctionMethod(String classname,
String functionName)
Returns the method that implements the given function in the class for the given class. |
static Map<Class<? extends HtmlElement>,Class<? extends SimpleScriptable>> |
getHtmlJavaScriptMapping()
Returns an immutable map containing the HTML to JavaScript mappings. |
static JavaScriptConfiguration |
getInstance(BrowserVersion browserVersion)
Returns the instance that represents the configuration for the specified BrowserVersion . |
Method |
getPropertyReadMethod(Class<?> clazz,
String propertyName)
Gets the method that implements the getter for the given property based upon the class object. |
Method |
getPropertyReadMethod(String classname,
String propertyName)
Returns the method that implements the get function for in the class for the given class. |
Method |
getPropertyWriteMethod(Class<?> clazz,
String propertyName)
Gets the method that implements the setter for the given property based upon the class object. |
Method |
getPropertyWriteMethod(String classname,
String propertyName)
Returns the method that implements the set function in the class for the given class. |
protected static boolean |
isDocumentLoaded()
Test for a configuration having been loaded for testing. |
Set<String> |
keySet()
Gets the set of keys for the class configurations. |
protected static void |
loadConfiguration()
Gets the configuration file and make it an input reader and then pass to the method to read the file. |
protected static void |
loadConfiguration(Reader configurationReader)
Loads the configuration from a supplied Reader. |
boolean |
propertyExists(Class<?> clazz,
String propertyName)
Checks to see if there is an entry for the given property. |
boolean |
propertyExists(String classname,
String propertyName)
Checks to see if there is an entry for the given property. |
protected static void |
resetClassForTesting()
Resets this class to its initial state. |
protected static void |
setXmlDocument(Document document)
Sets the document configuration for testing. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ENABLED
public static final int DISABLED
public static final int NOT_FOUND
Method Detail |
---|
protected static boolean isDocumentLoaded()
protected static void resetClassForTesting()
protected static void setXmlDocument(Document document)
document
- - The configuration documentprotected static void loadConfiguration()
protected static void loadConfiguration(Reader configurationReader)
configurationReader
- - A reader pointing to the configurationpublic static JavaScriptConfiguration getInstance(BrowserVersion browserVersion)
BrowserVersion
.
This method is synchronized to allow multithreaded access to the JavaScript configuration.
browserVersion
- the BrowserVersion
BrowserVersion
public Set<String> keySet()
protected boolean classConfigEquals(String classname, ClassConfiguration config)
classname
- - the parsed classname to testconfig
- - the expected configuration
public ClassConfiguration getClassConfiguration(String classname)
classname
- the js class name
protected Class<?> getClassObject(String classname)
classname
- the classname that you want the implementing class for (for testing only)
public Method getPropertyReadMethod(Class<?> clazz, String propertyName)
clazz
- the actual class to use as referencepropertyName
- the property to find the getter for
public Method getPropertyReadMethod(String classname, String propertyName)
classname
- the name of the class to work withpropertyName
- the property to find the getter for
public Method getPropertyWriteMethod(Class<?> clazz, String propertyName)
clazz
- the actual class to use as referencepropertyName
- the property to find the getter for
public Method getPropertyWriteMethod(String classname, String propertyName)
classname
- the name of the class to work withpropertyName
- the property to find the setter for
public Method getFunctionMethod(Class<?> clazz, String functionName)
clazz
- the actual class to use as referencefunctionName
- the function to find the method for
public Method getFunctionMethod(String classname, String functionName)
classname
- the name of the class to work withfunctionName
- the function to find the method for
public boolean propertyExists(Class<?> clazz, String propertyName)
clazz
- the class the property is forpropertyName
- the name of the property
public boolean propertyExists(String classname, String propertyName)
classname
- the class the property is forpropertyName
- the name of the property
public static Map<Class<? extends HtmlElement>,Class<? extends SimpleScriptable>> getHtmlJavaScriptMapping()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |