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, 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: 9092 $
Author:
Ben Curren, Ahmed Ashour, Chuck Dumont, Ronald Brill, Frank Danek
See Also:
WebClient, Serialized Form

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.
 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 instantiates the MSXML (ActiveX) object if requested (XMLDOMDocument, XMLHTTPRequest, XSLTemplate) searches the map specified in the WebClient class for the Java object to instantiate based on the ActiveXObject constructor String uses ActiveXObjectImpl to initiate Jacob.
 
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, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement, setParentScope
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
  1. instantiates the MSXML (ActiveX) object if requested (XMLDOMDocument, XMLHTTPRequest, XSLTemplate)
  2. searches the map specified in the WebClient class for the Java object to instantiate based on the ActiveXObject constructor String
  3. uses ActiveXObjectImpl to initiate Jacob.

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

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–2014 Gargoyle Software Inc.. All rights reserved.