Package org.mozilla.javascript.xmlimpl
Class QName
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.javascript.IdScriptableObject
-
- org.mozilla.javascript.xmlimpl.QName
-
- All Implemented Interfaces:
java.io.Serializable
,ConstProperties
,DebuggableObject
,IdFunctionCall
,Scriptable
,SymbolScriptable
final class QName extends IdScriptableObject
Class QName
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private XmlNode.QName
delegate
private static int
Id_constructor
private static int
Id_localName
private static int
Id_toSource
private static int
Id_toString
private static int
Id_uri
private XMLLibImpl
lib
private static int
MAX_INSTANCE_ID
private static int
MAX_PROTOTYPE_ID
private QName
prototype
private static java.lang.Object
QNAME_TAG
(package private) static long
serialVersionUID
-
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 private
QName()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) QName
castToQName(XMLLibImpl lib, Context cx, java.lang.Object qnameValue)
(package private) QName
constructQName(XMLLibImpl lib, Context cx, java.lang.Object nameValue)
(package private) QName
constructQName(XMLLibImpl lib, Context cx, java.lang.Object namespace, java.lang.Object name)
(package private) static QName
create(XMLLibImpl lib, Scriptable scope, QName prototype, XmlNode.QName delegate)
boolean
equals(java.lang.Object obj)
private boolean
equals(QName q)
protected java.lang.Object
equivalentValues(java.lang.Object value)
Custom==
operator.java.lang.Object
execIdCall(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.(package private) void
exportAsJSClass(boolean sealed)
protected int
findInstanceIdInfo(java.lang.String s)
Map name to id of instance property.protected int
findPrototypeId(java.lang.String s)
java.lang.String
getClassName()
Return the name of the class.java.lang.Object
getDefaultValue(java.lang.Class<?> hint)
Implements the [[DefaultValue]] internal method.(package private) XmlNode.QName
getDelegate()
protected java.lang.String
getInstanceIdName(int id)
Map id back to property name it defines.protected java.lang.Object
getInstanceIdValue(int id)
Get id value.protected int
getMaxInstanceId()
Get maximum id findInstanceIdInfo can generate.int
hashCode()
protected void
initPrototypeId(int id)
private java.lang.String
js_toSource()
private java.lang.Object
jsConstructor(Context cx, boolean inNewExpr, java.lang.Object[] args)
java.lang.String
localName()
(package private) QName
newQName(XMLLibImpl lib, java.lang.String q_uri, java.lang.String q_localName, java.lang.String q_prefix)
(package private) java.lang.String
prefix()
private QName
realThis(Scriptable thisObj, IdFunctionObject f)
(package private) XmlNode.QName
toNodeQname()
Deprecated.private static void
toSourceImpl(java.lang.String uri, java.lang.String localName, java.lang.String prefix, java.lang.StringBuilder sb)
java.lang.String
toString()
(package private) java.lang.String
uri()
-
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
-
QNAME_TAG
private static final java.lang.Object QNAME_TAG
-
lib
private XMLLibImpl lib
-
prototype
private QName prototype
-
delegate
private XmlNode.QName delegate
-
Id_localName
private static final int Id_localName
- 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 QName create(XMLLibImpl lib, Scriptable scope, QName prototype, XmlNode.QName delegate)
-
exportAsJSClass
void exportAsJSClass(boolean sealed)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
localName
public java.lang.String localName()
-
prefix
java.lang.String prefix()
-
uri
java.lang.String uri()
-
toNodeQname
@Deprecated final XmlNode.QName toNodeQname()
Deprecated.
-
getDelegate
final XmlNode.QName getDelegate()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equivalentValues
protected java.lang.Object equivalentValues(java.lang.Object value)
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
-
equals
private boolean equals(QName q)
-
getClassName
public java.lang.String 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
public java.lang.Object getDefaultValue(java.lang.Class<?> hint)
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
protected int findInstanceIdInfo(java.lang.String s)
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
protected java.lang.String getInstanceIdName(int id)
Description copied from class:IdScriptableObject
Map id back to property name it defines.- Overrides:
getInstanceIdName
in classIdScriptableObject
-
getInstanceIdValue
protected java.lang.Object getInstanceIdValue(int id)
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
protected int findPrototypeId(java.lang.String s)
- Overrides:
findPrototypeId
in classIdScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id)
- Overrides:
initPrototypeId
in 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:
execIdCall
in interfaceIdFunctionCall
- Overrides:
execIdCall
in classIdScriptableObject
-
realThis
private QName realThis(Scriptable thisObj, IdFunctionObject f)
-
newQName
QName newQName(XMLLibImpl lib, java.lang.String q_uri, java.lang.String q_localName, java.lang.String q_prefix)
-
constructQName
QName constructQName(XMLLibImpl lib, Context cx, java.lang.Object namespace, java.lang.Object name)
-
constructQName
QName constructQName(XMLLibImpl lib, Context cx, java.lang.Object nameValue)
-
castToQName
QName castToQName(XMLLibImpl lib, Context cx, java.lang.Object qnameValue)
-
jsConstructor
private java.lang.Object jsConstructor(Context cx, boolean inNewExpr, java.lang.Object[] args)
-
js_toSource
private java.lang.String js_toSource()
-
toSourceImpl
private static void toSourceImpl(java.lang.String uri, java.lang.String localName, java.lang.String prefix, java.lang.StringBuilder sb)
-
-