com.gargoylesoftware.htmlunit.javascript.host
Class Console

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.Console
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 Console
extends SimpleScriptable

A JavaScript object for a console. This implementation simulates Firefox's console, which utilizes FireBug API.

Version:
$Revision: 8344 $
Author:
Andrea Martino
See Also:
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
Console()
           
 
Method Summary
static void debug(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function funObj)
          This method performs logging to the console at "debug" level.
 void dir(Object o)
          Implementation of console dir function.
static void error(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function funObj)
          This method performs logging to the console at "error" level.
 void group()
          Implementation of group.
 void groupCollapsed()
          Implementation of groupCollapsed.
 void groupEnd()
          Implementation of endGroup.
static void info(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function funObj)
          This method performs logging to the console at "info" level.
static void log(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function funObj)
          This method performs logging to the console at "log" level.
 void setWebWindow(WebWindow webWindow)
          Sets the Window JavaScript object this console belongs to.
 void time(String timerName)
          This method replicates Firefox's behavior: if the timer already exists, the start time is not overwritten.
 void timeEnd(String timerName)
          This method replicates Firefox's behavior: if no timer is found, nothing is logged to the console.
static void trace(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function funObj)
          This method performs logging to the console at "trace" level.
static void warn(net.sourceforge.htmlunit.corejs.javascript.Context cx, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function funObj)
          This method performs logging to the console at "warn" level.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, 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

Console

public Console()
Method Detail

setWebWindow

public void setWebWindow(WebWindow webWindow)
Sets the Window JavaScript object this console belongs to.

Parameters:
webWindow - the Window JavaScript object this console belongs to

log

public static void log(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                       net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                       Object[] args,
                       net.sourceforge.htmlunit.corejs.javascript.Function funObj)
This method performs logging to the console at "log" level.

Parameters:
cx - the JavaScript context
thisObj - the scriptable
args - the arguments passed into the method
funObj - the function

info

public static void info(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                        net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                        Object[] args,
                        net.sourceforge.htmlunit.corejs.javascript.Function funObj)
This method performs logging to the console at "info" level.

Parameters:
cx - the JavaScript context
thisObj - the scriptable
args - the arguments passed into the method
funObj - the function

warn

public static void warn(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                        net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                        Object[] args,
                        net.sourceforge.htmlunit.corejs.javascript.Function funObj)
This method performs logging to the console at "warn" level.

Parameters:
cx - the JavaScript context
thisObj - the scriptable
args - the arguments passed into the method
funObj - the function

error

public static void error(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                         net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                         Object[] args,
                         net.sourceforge.htmlunit.corejs.javascript.Function funObj)
This method performs logging to the console at "error" level.

Parameters:
cx - the JavaScript context
thisObj - the scriptable
args - the arguments passed into the method
funObj - the function

debug

public static void debug(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                         net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                         Object[] args,
                         net.sourceforge.htmlunit.corejs.javascript.Function funObj)
This method performs logging to the console at "debug" level.

Parameters:
cx - the JavaScript context
thisObj - the scriptable
args - the arguments passed into the method
funObj - the function

trace

public static void trace(net.sourceforge.htmlunit.corejs.javascript.Context cx,
                         net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                         Object[] args,
                         net.sourceforge.htmlunit.corejs.javascript.Function funObj)
This method performs logging to the console at "trace" level.

Parameters:
cx - the JavaScript context
thisObj - the scriptable
args - the arguments passed into the method
funObj - the function

dir

public void dir(Object o)
Implementation of console dir function. This method does not enter recursively in the passed object, nor prints the details of objects or functions.

Parameters:
o - the object to be printed

group

public void group()
Implementation of group. Currently missing.


groupEnd

public void groupEnd()
Implementation of endGroup. Currently missing.


groupCollapsed

public void groupCollapsed()
Implementation of groupCollapsed. Currently missing.


time

public void time(String timerName)
This method replicates Firefox's behavior: if the timer already exists, the start time is not overwritten. In both cases, the line is printed on the console.

Parameters:
timerName - the name of the timer

timeEnd

public void timeEnd(String timerName)
This method replicates Firefox's behavior: if no timer is found, nothing is logged to the console.

Parameters:
timerName - the name of the timer


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