Package org.mozilla.javascript.xmlimpl
Class Namespace
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.javascript.IdScriptableObject
-
- org.mozilla.javascript.xmlimpl.Namespace
-
- All Implemented Interfaces:
java.io.Serializable,ConstProperties,DebuggableObject,IdFunctionCall,Scriptable,SymbolScriptable
class Namespace extends IdScriptableObject
Class Namespace
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private static intId_constructorprivate static intId_prefixprivate static intId_toSourceprivate static intId_toStringprivate static intId_uriprivate static intMAX_INSTANCE_IDprivate static intMAX_PROTOTYPE_IDprivate static java.lang.ObjectNAMESPACE_TAGprivate XmlNode.Namespacensprivate Namespaceprototype(package private) static longserialVersionUID-
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 Modifier Constructor Description privateNamespace()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) NamespacecastToNamespace(java.lang.Object namespaceObj)private NamespaceconstructNamespace()(package private) NamespaceconstructNamespace(java.lang.Object uriValue)private NamespaceconstructNamespace(java.lang.Object prefixValue, java.lang.Object uriValue)(package private) static Namespacecreate(Scriptable scope, Namespace prototype, XmlNode.Namespace namespace)booleanequals(java.lang.Object obj)private booleanequals(Namespace n)protected java.lang.ObjectequivalentValues(java.lang.Object value)Custom==operator.java.lang.ObjectexecIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)'thisObj' will be null if invoked as constructor, in which case * instance of Scriptable should be returned.voidexportAsJSClass(boolean sealed)protected intfindInstanceIdInfo(java.lang.String s)Map name to id of instance property.protected intfindPrototypeId(java.lang.String s)java.lang.StringgetClassName()Return the name of the class.java.lang.ObjectgetDefaultValue(java.lang.Class<?> hint)Implements the [[DefaultValue]] internal method.(package private) XmlNode.NamespacegetDelegate()protected java.lang.StringgetInstanceIdName(int id)Map id back to property name it defines.protected java.lang.ObjectgetInstanceIdValue(int id)Get id value.protected intgetMaxInstanceId()Get maximum id findInstanceIdInfo can generate.inthashCode()protected voidinitPrototypeId(int id)private java.lang.Stringjs_toSource()private java.lang.ObjectjsConstructor(Context cx, boolean inNewExpr, java.lang.Object[] args)(package private) NamespacenewNamespace(java.lang.String uri)(package private) NamespacenewNamespace(java.lang.String prefix, java.lang.String uri)java.lang.Stringprefix()private NamespacerealThis(Scriptable thisObj, IdFunctionObject f)java.lang.StringtoLocaleString()(package private) static voidtoSourceImpl(java.lang.String prefix, java.lang.String uri, java.lang.StringBuilder sb)java.lang.StringtoString()java.lang.Stringuri()-
Methods inherited from class org.mozilla.javascript.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 org.mozilla.javascript.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 Detail
-
serialVersionUID
static final long serialVersionUID
- See Also:
- Constant Field Values
-
NAMESPACE_TAG
private static final java.lang.Object NAMESPACE_TAG
-
prototype
private Namespace prototype
-
ns
private XmlNode.Namespace ns
-
Id_prefix
private static final int Id_prefix
- See Also:
- Constant Field Values
-
Id_uri
private static final int Id_uri
- See Also:
- Constant Field Values
-
MAX_INSTANCE_ID
private static final int MAX_INSTANCE_ID
- See Also:
- Constant Field Values
-
Id_constructor
private static final int Id_constructor
- See Also:
- Constant Field Values
-
Id_toString
private static final int Id_toString
- See Also:
- Constant Field Values
-
Id_toSource
private static final int Id_toSource
- See Also:
- Constant Field Values
-
MAX_PROTOTYPE_ID
private static final int MAX_PROTOTYPE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
create
static Namespace create(Scriptable scope, Namespace prototype, XmlNode.Namespace namespace)
-
getDelegate
final XmlNode.Namespace getDelegate()
-
exportAsJSClass
public void exportAsJSClass(boolean sealed)
-
uri
public java.lang.String uri()
-
prefix
public java.lang.String prefix()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toLocaleString
public java.lang.String toLocaleString()
-
equals
private boolean equals(Namespace n)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equivalentValues
protected java.lang.Object equivalentValues(java.lang.Object value)
Description copied from class:ScriptableObjectCustom==operator. Must returnScriptable.NOT_FOUNDif this object does not have custom equality operator for the given value,Boolean.TRUEif this object is equivalent tovalue,Boolean.FALSEif this object is not equivalent tovalue.The default implementation returns Boolean.TRUE if
this == valueorScriptable.NOT_FOUNDotherwise. It indicates that by default custom equality is available only ifvalueisthisin which case true is returned.- Overrides:
equivalentValuesin classScriptableObject
-
getClassName
public java.lang.String getClassName()
Description copied from class:ScriptableObjectReturn the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassNamein interfaceScriptable- Specified by:
getClassNamein classScriptableObject
-
getDefaultValue
public java.lang.Object getDefaultValue(java.lang.Class<?> hint)
Description copied from class:ScriptableObjectImplements 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
hintof null means "no hint".- Specified by:
getDefaultValuein interfaceScriptable- Overrides:
getDefaultValuein 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:IdScriptableObjectGet maximum id findInstanceIdInfo can generate.- Overrides:
getMaxInstanceIdin classIdScriptableObject
-
findInstanceIdInfo
protected int findInstanceIdInfo(java.lang.String s)
Description copied from class:IdScriptableObjectMap name to id of instance property. Should return 0 if not found or the result ofIdScriptableObject.instanceIdInfo(int, int).- Overrides:
findInstanceIdInfoin classIdScriptableObject
-
getInstanceIdName
protected java.lang.String getInstanceIdName(int id)
Description copied from class:IdScriptableObjectMap id back to property name it defines.- Overrides:
getInstanceIdNamein classIdScriptableObject
-
getInstanceIdValue
protected java.lang.Object getInstanceIdValue(int id)
Description copied from class:IdScriptableObjectGet 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:
getInstanceIdValuein classIdScriptableObject
-
findPrototypeId
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeIdin classIdScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeIdin classIdScriptableObject
-
execIdCall
public java.lang.Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope, Scriptable thisObj, java.lang.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:
execIdCallin interfaceIdFunctionCall- Overrides:
execIdCallin classIdScriptableObject
-
realThis
private Namespace realThis(Scriptable thisObj, IdFunctionObject f)
-
newNamespace
Namespace newNamespace(java.lang.String uri)
-
newNamespace
Namespace newNamespace(java.lang.String prefix, java.lang.String uri)
-
constructNamespace
Namespace constructNamespace(java.lang.Object uriValue)
-
castToNamespace
Namespace castToNamespace(java.lang.Object namespaceObj)
-
constructNamespace
private Namespace constructNamespace(java.lang.Object prefixValue, java.lang.Object uriValue)
-
constructNamespace
private Namespace constructNamespace()
-
jsConstructor
private java.lang.Object jsConstructor(Context cx, boolean inNewExpr, java.lang.Object[] args)
-
js_toSource
private java.lang.String js_toSource()
-
toSourceImpl
static void toSourceImpl(java.lang.String prefix, java.lang.String uri, java.lang.StringBuilder sb)
-
-