com.gargoylesoftware.htmlunit.javascript.configuration
Class ClassConfiguration

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

public final class ClassConfiguration
extends Object

A container for all the JavaScript configuration information for one class.

Version:
$Revision: 7931 $
Author:
Mike Bowler, Chris Erskine, Ahmed Ashour, Ronald Brill

Nested Class Summary
static class ClassConfiguration.PropertyInfo
          Class used to contain the property information if the property is readable, writable and the methods that implement the get and set functions.
 
Constructor Summary
ClassConfiguration(Class<? extends SimpleScriptable> hostClass, Class<?>[] domClasses, boolean jsObject)
          Constructor.
 
Method Summary
 void addConstant(String name)
          Add the constant to the configuration.
 void addFunction(Method method)
          Add the function to the configuration.
 void addProperty(String name, Method getter, Method setter)
          Add the property to the configuration.
 List<String> constants()
          Returns the constant list.
 Set<Map.Entry<String,Method>> functionEntries()
          Returns the set of entries for the defined functions.
 Set<String> functionKeys()
          Returns the set of keys for the defined functions.
 Class<?>[] getDomClasses()
          Returns the DOM classes.
 String getExtendedClassName()
           
 Class<? extends SimpleScriptable> getHostClass()
          Gets the class of the JavaScript host object.
 Method getJsConstructor()
          Gets the JavaScript constructor method in getHostClass().
 boolean isJsObject()
           
 Set<Map.Entry<String,ClassConfiguration.PropertyInfo>> propertyEntries()
          Returns the set of entries for the defined properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassConfiguration

public ClassConfiguration(Class<? extends SimpleScriptable> hostClass,
                          Class<?>[] domClasses,
                          boolean jsObject)
Constructor.

Parameters:
hostClass - - the class implementing this functionality
domClasses - the DOM classes that this object supports
jsObject - boolean flag for if this object is a JavaScript object
Method Detail

addProperty

public void addProperty(String name,
                        Method getter,
                        Method setter)
Add the property to the configuration.

Parameters:
name - name of the property
getter - the getter method
setter - the setter method

addConstant

public void addConstant(String name)
Add the constant to the configuration.

Parameters:
name - - Name of the configuration

propertyEntries

public Set<Map.Entry<String,ClassConfiguration.PropertyInfo>> propertyEntries()
Returns the set of entries for the defined properties.

Returns:
a set

functionEntries

public Set<Map.Entry<String,Method>> functionEntries()
Returns the set of entries for the defined functions.

Returns:
a set

functionKeys

public Set<String> functionKeys()
Returns the set of keys for the defined functions.

Returns:
a set

constants

public List<String> constants()
Returns the constant list.

Returns:
a list

addFunction

public void addFunction(Method method)
Add the function to the configuration.

Parameters:
method - the method

getExtendedClassName

public String getExtendedClassName()
Returns:
the extendedClass

getHostClass

public Class<? extends SimpleScriptable> getHostClass()
Gets the class of the JavaScript host object.

Returns:
the class of the JavaScript host object

getJsConstructor

public Method getJsConstructor()
Gets the JavaScript constructor method in getHostClass().

Returns:
the JavaScript constructor method in getHostClass()

getDomClasses

public Class<?>[] getDomClasses()
Returns the DOM classes.

Returns:
the DOM classes

isJsObject

public boolean isJsObject()
Returns:
the jsObject


Copyright © 2002–2013 Gargoyle Software Inc.. All rights reserved.