com.gargoylesoftware.htmlunit.javascript.configuration
Class ClassConfiguration

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.javascript.configuration.ClassConfiguration

public final class ClassConfiguration
extends java.lang.Object

A container for all the javascript configuration information.

Version:
$Revision: 1.3 $
Author:
Mike Bowler, Chris Erskine, Ahmed Ashour

Constructor Summary
ClassConfiguration(java.lang.String classname, java.lang.String implementingClass, java.lang.String jsConstructor, java.lang.String extendedClass, java.lang.String htmlClass, boolean jsObject)
 Constructor
 
Method Summary
 void addFunction(java.lang.String name)
 Add the function to the configuration
 void addProperty(java.lang.String name, boolean readable, boolean writeable)
 Add the property to the configuration
 boolean equals(java.lang.Object obj)
 Test for value equality of the 2 objects
 java.util.Set functionKeys()
 Return the set of keys for the defined functions
 java.lang.String getClassName()
  
 java.lang.String getExtendedClass()
  
 java.lang.reflect.Method getFunctionMethod(java.lang.String functionName)
 Gets the method that implements the given function
 java.lang.String getHtmlClassname()
  
 java.lang.reflect.Method getJsConstructor()
 Gets the JavaScript constructor method in getLinkedClass()
 java.lang.Class getLinkedClass()
 Gets the class of the Javascript host object
 java.lang.reflect.Method getPropertyReadMethod(java.lang.String propertyName)
 Gets the method that implements the getter for the named property
 java.lang.reflect.Method getPropertyWriteMethod(java.lang.String propertyName)
 Gets the method that implements the setter for the named property
 int hashCode()
 Currently, this is the hashcode for the name.
 boolean isJsObject()
  
 java.util.Set propertyKeys()
 Return the set of keys for the defined properties.
 void setBrowser(java.lang.String propertyName, java.lang.String browserName)
 Set the browser information for this named property
 void setExtendedClass(java.lang.String extendedClass)
  
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassConfiguration

public ClassConfiguration(java.lang.String classname,
                          java.lang.String implementingClass,
                          java.lang.String jsConstructor,
                          java.lang.String extendedClass,
                          java.lang.String htmlClass,
                          boolean jsObject)
                   throws java.lang.ClassNotFoundException
Constructor

Parameters:
classname - the name of the configuration class this entry is for
implementingClass - - the fully qualified name of the class implementing this functionality
jsConstructor - the constructor of method implementingClass
extendedClass - - The name of the class that this class extends
htmlClass - The name of the html class that this object supports
jsObject - boolean flag for if this object is a JavaScript object
Throws:
java.lang.ClassNotFoundException - - If the implementing class is not found
Method Detail

addFunction

public void addFunction(java.lang.String name)
Add the function to the configuration

Parameters:
name - - Name of the function

addProperty

public void addProperty(java.lang.String name,
                        boolean readable,
                        boolean writeable)
Add the property to the configuration

Parameters:
name - - Name of the property
readable - - Flag for if the property is readable
writeable - - Flag for if the property is writeable

equals

public boolean equals(java.lang.Object obj)
Test for value equality of the 2 objects

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if the value of this object is the same as the obj argument; false otherwise.

functionKeys

public java.util.Set functionKeys()
Return the set of keys for the defined functions

Returns:
a set

getClassName

public java.lang.String getClassName()
Returns:
Returns the className.

getExtendedClass

public java.lang.String getExtendedClass()
Returns:
Returns the extendedClass.

getFunctionMethod

public java.lang.reflect.Method getFunctionMethod(java.lang.String functionName)
Gets the method that implements the given function

Parameters:
functionName - The name of the property
Returns:
Method

getHtmlClassname

public java.lang.String getHtmlClassname()
Returns:
Returns the htmlClassname.

getJsConstructor

public java.lang.reflect.Method getJsConstructor()
Gets the JavaScript constructor method in getLinkedClass()

Returns:
Returns the constructor Method.

getLinkedClass

public java.lang.Class getLinkedClass()
Gets the class of the Javascript host object

Returns:
Returns the linkedClass.

getPropertyReadMethod

public java.lang.reflect.Method getPropertyReadMethod(java.lang.String propertyName)
Gets the method that implements the getter for the named property

Parameters:
propertyName - The name of the property
Returns:
Method

getPropertyWriteMethod

public java.lang.reflect.Method getPropertyWriteMethod(java.lang.String propertyName)
Gets the method that implements the setter for the named property

Parameters:
propertyName - The name of the property
Returns:
Method

hashCode

public int hashCode()
Currently, this is the hashcode for the name.

Overrides:
hashCode in class java.lang.Object

isJsObject

public boolean isJsObject()
Returns:
Returns the jsObject.

propertyKeys

public java.util.Set propertyKeys()
Return the set of keys for the defined properties.

Returns:
a set

setBrowser

public void setBrowser(java.lang.String propertyName,
                       java.lang.String browserName)
                throws java.lang.IllegalStateException
Set the browser information for this named property

Parameters:
propertyName - - Name of the property to set
browserName - - Browser name to set
Throws:
java.lang.IllegalStateException - - Property does not exist

setExtendedClass

public void setExtendedClass(java.lang.String extendedClass)
Parameters:
extendedClass - The extendedClass to set.


Copyright © 2003-2016 AppPerfect Corporation. All Rights Reserved.