Class ConsoleObject

java.lang.Object
org.mozilla.javascript.SlotMapOwner
org.mozilla.javascript.ScriptableObject
org.rapidcontext.core.js.ConsoleObject
All Implemented Interfaces:
Serializable, org.mozilla.javascript.ConstProperties, org.mozilla.javascript.debug.DebuggableObject, org.mozilla.javascript.Scriptable, org.mozilla.javascript.SymbolScriptable, org.mozilla.javascript.Wrapper

public class ConsoleObject extends org.mozilla.javascript.ScriptableObject implements org.mozilla.javascript.Wrapper
A JavaScript console object. This class provides a subset of the standard JavaScript console object for logging.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject

    org.mozilla.javascript.ScriptableObject.DescriptorInfo, org.mozilla.javascript.ScriptableObject.KeyComparator, org.mozilla.javascript.ScriptableObject.LambdaGetterFunction, org.mozilla.javascript.ScriptableObject.LambdaSetterFunction
  • Field Summary

    Fields inherited from class org.mozilla.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from interface org.mozilla.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConsoleObject(String prefix, org.mozilla.javascript.Scriptable parentScope)
    Creates a new console object with a specific prefix.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    error(Object... args)
    Logs an error message.
    get(String name, org.mozilla.javascript.Scriptable start)
    Returns a named property from this object.
    Returns the class name.
    void
    info(Object... args)
    Logs an info message.
    void
    log(Object... args)
    Logs a debug message.
    Returns the wrapped object.
    void
    warn(Object... args)
    Logs a warning message.

    Methods inherited from class org.mozilla.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, equivalentValues, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size

    Methods inherited from class org.mozilla.javascript.SlotMapOwner

    createSlotMap

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConsoleObject

      public ConsoleObject(String prefix, org.mozilla.javascript.Scriptable parentScope)
      Creates a new console object with a specific prefix.
      Parameters:
      prefix - the logging prefix text
      parentScope - the object parent scope
  • Method Details

    • getClassName

      public String getClassName()
      Returns the class name.
      Specified by:
      getClassName in interface org.mozilla.javascript.Scriptable
      Specified by:
      getClassName in class org.mozilla.javascript.ScriptableObject
      Returns:
      the class name
    • get

      public Object get(String name, org.mozilla.javascript.Scriptable start)
      Returns a named property from this object.
      Specified by:
      get in interface org.mozilla.javascript.Scriptable
      Overrides:
      get in class org.mozilla.javascript.ScriptableObject
      Parameters:
      name - the name of the property
      start - the object in which the lookup began
      Returns:
      the value of the property, or NOT_FOUND if not found
    • error

      public void error(Object... args)
      Logs an error message.
      Parameters:
      args - the log message arguments
    • warn

      public void warn(Object... args)
      Logs a warning message.
      Parameters:
      args - the log message arguments
    • info

      public void info(Object... args)
      Logs an info message.
      Parameters:
      args - the log message arguments
    • log

      public void log(Object... args)
      Logs a debug message.
      Parameters:
      args - the log message arguments
    • unwrap

      public Object unwrap()
      Returns the wrapped object.
      Specified by:
      unwrap in interface org.mozilla.javascript.Wrapper
      Returns:
      the unwrapped object