Class Namespace
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.xmlimpl.Namespace
- All Implemented Interfaces:
Serializable, ConstProperties, DebuggableObject, IdFunctionCall, Scriptable, SymbolScriptable
Class Namespace
-
Nested Class Summary
Nested classes/interfaces inherited from class ScriptableObject
ScriptableObject.KeyComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final Object
private XmlNode.Namespace
private Namespace
(package private) static final long
Fields inherited from class ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface Scriptable
NOT_FOUND
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Namespace
castToNamespace
(Object namespaceObj) private Namespace
(package private) Namespace
constructNamespace
(Object uriValue) private Namespace
constructNamespace
(Object prefixValue, Object uriValue) (package private) static Namespace
create
(Scriptable scope, Namespace prototype, XmlNode.Namespace namespace) boolean
private boolean
protected Object
equivalentValues
(Object value) Custom==
operator.execIdCall
(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) 'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.void
exportAsJSClass
(boolean sealed) protected int
Map name to id of instance property.protected int
Return the name of the class.getDefaultValue
(Class<?> hint) Implements the [[DefaultValue]] internal method.(package private) final XmlNode.Namespace
protected String
getInstanceIdName
(int id) Map id back to property name it defines.protected Object
getInstanceIdValue
(int id) Get id value.protected int
Get maximum id findInstanceIdInfo can generate.int
hashCode()
protected void
initPrototypeId
(int id) private String
private Object
jsConstructor
(Context cx, boolean inNewExpr, Object[] args) (package private) Namespace
newNamespace
(String uri) (package private) Namespace
newNamespace
(String prefix, String uri) prefix()
private Namespace
realThis
(Scriptable thisObj, IdFunctionObject f) (package private) static void
toSourceImpl
(String prefix, String uri, StringBuilder sb) toString()
uri()
Methods inherited from class IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, delete, ensureType, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findPrototypeId, get, get, getAttributes, getAttributes, getOwnPropertyDescriptor, has, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, put, setAttributes, setInstanceIdAttributes, setInstanceIdValue
Methods inherited from class ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
Field Details
-
serialVersionUID
static final long serialVersionUID- See Also:
-
NAMESPACE_TAG
-
prototype
-
ns
-
Id_prefix
private static final int Id_prefix- See Also:
-
Id_uri
private static final int Id_uri- See Also:
-
MAX_INSTANCE_ID
private static final int MAX_INSTANCE_ID- See Also:
-
Id_constructor
private static final int Id_constructor- See Also:
-
Id_toString
private static final int Id_toString- See Also:
-
Id_toSource
private static final int Id_toSource- See Also:
-
MAX_PROTOTYPE_ID
private static final int MAX_PROTOTYPE_ID- See Also:
-
-
Constructor Details
-
Namespace
private Namespace()
-
-
Method Details
-
create
-
getDelegate
-
exportAsJSClass
public void exportAsJSClass(boolean sealed) -
uri
-
prefix
-
toString
-
toLocaleString
-
equals
-
equals
-
hashCode
-
equivalentValues
Description copied from class:ScriptableObject
Custom==
operator. Must returnScriptable.NOT_FOUND
if this object does not have custom equality operator for the given value,Boolean.TRUE
if this object is equivalent tovalue
,Boolean.FALSE
if this object is not equivalent tovalue
.The default implementation returns Boolean.TRUE if
this == value
orScriptable.NOT_FOUND
otherwise. It indicates that by default custom equality is available only ifvalue
isthis
in which case true is returned.- Overrides:
equivalentValues
in classScriptableObject
-
getClassName
Description copied from class:ScriptableObject
Return the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassName
in interfaceScriptable
- Specified by:
getClassName
in classScriptableObject
-
getDefaultValue
Description copied from class:ScriptableObject
Implements the [[DefaultValue]] internal method.Note that the toPrimitive conversion is a no-op for every type other than Object, for which [[DefaultValue]] is called. See ECMA 9.1.
A
hint
of null means "no hint".- Specified by:
getDefaultValue
in interfaceScriptable
- Overrides:
getDefaultValue
in classScriptableObject
- Parameters:
hint
- the type hint- Returns:
- the default value for the object
See ECMA 8.6.2.6.
-
getMaxInstanceId
protected int getMaxInstanceId()Description copied from class:IdScriptableObject
Get maximum id findInstanceIdInfo can generate.- Overrides:
getMaxInstanceId
in classIdScriptableObject
-
findInstanceIdInfo
Description copied from class:IdScriptableObject
Map name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int)
.- Overrides:
findInstanceIdInfo
in classIdScriptableObject
-
getInstanceIdName
Description copied from class:IdScriptableObject
Map id back to property name it defines.- Overrides:
getInstanceIdName
in classIdScriptableObject
-
getInstanceIdValue
Description copied from class:IdScriptableObject
Get id value. * If id value is constant, descendant can call cacheIdValue to store * value in the permanent cache. * Default implementation creates IdFunctionObject instance for given id * and cache its value- Overrides:
getInstanceIdValue
in classIdScriptableObject
-
findPrototypeId
- Overrides:
findPrototypeId
in classIdScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id) - Overrides:
initPrototypeId
in classIdScriptableObject
-
execIdCall
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, Object[] args) Description copied from class:IdScriptableObject
'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.- Specified by:
execIdCall
in interfaceIdFunctionCall
- Overrides:
execIdCall
in classIdScriptableObject
-
realThis
-
newNamespace
-
newNamespace
-
constructNamespace
-
castToNamespace
-
constructNamespace
-
constructNamespace
-
jsConstructor
-
js_toSource
-
toSourceImpl
-