com.gargoylesoftware.htmlunit.javascript.host
Class ActiveXObject

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.ActiveXObject
All Implemented Interfaces:
Serializable, Cloneable, Map, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class ActiveXObject
extends SimpleScriptable

This is the host object that allows JavaScript to instantiate java objects via the ActiveXObject constructor. This host object enables a person to emulate ActiveXObjects in JavaScript with java objects. See the WebClient class to see how ActiveXObject string parameter specifies which java class is instantiated.

Version:
$Revision: 5631 $
Author:
Ben Curren, Ahmed Ashour
See Also:
WebClient, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
ActiveXObject()
          The default constructor.
 
Method Summary
static void addProperty(SimpleScriptable scriptable, String propertyName, boolean isGetter, boolean isSetter)
          Adds a specific property to this object.
static XMLDocument buildXMLDocument(WebWindow enclosingWindow)
          Builds XMLDocument.
 String getClassName()
          Gets the name of the host object class.
static net.sourceforge.htmlunit.corejs.javascript.Scriptable jsConstructor(net.sourceforge.htmlunit.corejs.javascript.Context cx, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function ctorObj, boolean inNewExpr)
          This method searches the map specified in the WebClient class for the java object to instantiate based on the ActiveXObject constructor String.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ActiveXObject

public ActiveXObject()
The default constructor.

Method Detail

jsConstructor

public static net.sourceforge.htmlunit.corejs.javascript.Scriptable jsConstructor(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                                                                                  Object[] args,
                                                                                  net.sourceforge.htmlunit.corejs.javascript.Function ctorObj,
                                                                                  boolean inNewExpr)
This method searches the map specified in the WebClient class for the java object to instantiate based on the ActiveXObject constructor String.

Parameters:
cx - the current context
args - the arguments to the ActiveXObject constructor
ctorObj - the function object
inNewExpr - Is new or not
Returns:
the java object to allow JavaScript to access

buildXMLDocument

public static XMLDocument buildXMLDocument(WebWindow enclosingWindow)
Builds XMLDocument.

Parameters:
enclosingWindow - the window
Returns:
the document

addProperty

public static void addProperty(SimpleScriptable scriptable,
                               String propertyName,
                               boolean isGetter,
                               boolean isSetter)
Adds a specific property to this object.

Parameters:
scriptable - the scriptable
propertyName - the property name
isGetter - is getter
isSetter - is setter

getClassName

public String getClassName()
Gets the name of the host object class.

Specified by:
getClassName in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
getClassName in class SimpleScriptable
Returns:
the JavaScript class name


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.