Class XMLObjectImpl
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.IdScriptableObject
org.mozilla.javascript.xml.XMLObject
org.mozilla.javascript.xmlimpl.XMLObjectImpl
- All Implemented Interfaces:
Serializable, ConstProperties, DebuggableObject, IdFunctionCall, Scriptable, SymbolScriptable
This abstract class describes what all XML objects (XML, XMLList) should
have in common.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ScriptableObject
ScriptableObject.KeyComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate XMLLibImplprivate static final intprivate booleanprivate static final longprivate static final ObjectFields inherited from class ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface Scriptable
NOT_FOUND -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedXMLObjectImpl(XMLLibImpl lib, Scriptable scope, XMLObject prototype) -
Method Summary
Modifier and TypeMethodDescription(package private) abstract voidaddMatches(XMLList rv, XMLName name) final ObjectCustom+operator.private static Object(package private) abstract XMLListchild(int index) (package private) abstract XMLList(package private) abstract XMLListchildren()(package private) abstract XMLListcomments()(package private) abstract boolean(package private) abstract XMLObjectImplcopy()(package private) final XML(package private) final NamespacecreateNamespace(XmlNode.Namespace declaration) (package private) final Namespace[]createNamespaces(XmlNode.Namespace[] declarations) voidRemoves a named property from the object.final booleanImplementation of ECMAScript [[Delete]].(package private) abstract voiddeleteXMLProperty(XMLName name) ecmaDelete(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.(package private) final String(package private) final XML(package private) abstract XMLListenterDotQuery(Scriptable scope) Wrap this object into NativeWith to implement the .() query.enterWith(Scriptable scope) Wrap this object into NativeWith to implement the with statement.protected final ObjectequivalentValues(Object value) XMLObject always compare with any value and equivalentValues never returnsScriptable.NOT_FOUNDfor them but rather calls equivalentXml(value) and wrap the result as Boolean.(package private) abstract booleanequivalentXml(Object target) Test XML equality with target the target.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.(package private) final voidexportAsJSClass(boolean sealed) protected intget(String name, Scriptable start) Returns the value of the named property or NOT_FOUND.final ObjectImplementation of ECMAScript [[Get]]final ObjectgetDefaultValue(Class<?> hint) Implements the [[DefaultValue]] internal method.getFunctionProperty(Context cx, int id) getFunctionProperty(Context cx, String name) (package private) XMLLibImplgetLib()private XMLListgetMatches(XMLName name) final ScriptableReturns the parent (enclosing) scope of the object.(package private) final XmlProcessorfinal ScriptableReturns the prototype of the object.(package private) abstract XMLgetXML()(package private) abstract ObjectgetXMLProperty(XMLName name) ecmaGet(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.booleanhas(String name, Scriptable start) Returns true if the named property is defined.final booleanImplementation of ECMAScript [[Has]](package private) abstract booleanfinal booleanhasInstance(Scriptable scriptable) Implements the instanceof operator.(package private) abstract booleanhasOwnProperty(XMLName xmlName) (package private) abstract boolean(package private) abstract booleanhasXMLProperty(XMLName name) ecmaHas(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.(package private) final voidinitialize(XMLLibImpl lib, Scriptable scope, XMLObject prototype) protected voidinitPrototypeId(int id) (package private) final booleanprotected abstract ObjectjsConstructor(Context cx, boolean inNewExpr, Object[] args) (package private) abstract intlength()Generic reference to implement x.@y, x..y etc.Generic reference to implement x::ns, x.@ns::y, x..@ns::y etc.(package private) final QName(package private) final QNamenewQName(XmlNode.QName name) (package private) final XMLnewTextElementXML(XmlNode reference, XmlNode.QName qname, String value) (package private) final XML(package private) final XMLnewXMLFromJs(Object inputObject) (package private) final XMLList(package private) final XMLList(package private) abstract void(package private) abstract Objectparent()(package private) abstract XMLListprocessingInstructions(XMLName xmlName) (package private) abstract booleanpropertyIsEnumerable(Object member) voidput(String name, Scriptable start, Object value) Sets the value of the named property, creating it if need be.final voidImplementation of ECMAScript [[Put]](package private) abstract voidputXMLProperty(XMLName name, Object value) ecmaPut(cx, id, value) calls this after resolving when id to XMLName and checking it is not Uint32 index.final voidsetParentScope(Scriptable parent) Sets the parent (enclosing) scope of the object.final voidsetPrototype(Scriptable prototype) Sets the prototype of the object.(package private) abstract XMLListtext()private Object[]toObjectArray(Object[] typed) (package private) abstract StringtoSource(int indent) abstract StringtoString()(package private) abstract String(package private) abstract ObjectvalueOf()(package private) XMLxmlFromNode(XmlNode node) private voidxmlMethodNotFound(Object object, String name) Methods inherited from class XMLObject
getExtraMethodSource, getTypeOfMethods inherited from class IdScriptableObject
activatePrototypeMap, addIdFunctionProperty, defaultGet, defaultHas, defaultPut, defineOwnProperty, delete, ensureType, exportAsJSClass, fillConstructorProperties, findInstanceIdInfo, findInstanceIdInfo, findPrototypeId, get, getAttributes, getAttributes, getInstanceIdName, getInstanceIdValue, getMaxInstanceId, getOwnPropertyDescriptor, has, hasPrototypeMap, initPrototypeConstructor, initPrototypeMethod, initPrototypeMethod, initPrototypeMethod, initPrototypeValue, initPrototypeValue, instanceIdInfo, put, setAttributes, setInstanceIdAttributes, setInstanceIdValueMethods 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, getClassName, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getProperty, getProperty, getProperty, getPropertyIds, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, has, 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, size
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
XMLOBJECT_TAG
-
lib
-
prototypeFlag
private boolean prototypeFlag -
Id_constructor
private static final int Id_constructor- See Also:
-
Id_addNamespace
private static final int Id_addNamespace- See Also:
-
Id_appendChild
private static final int Id_appendChild- See Also:
-
Id_attribute
private static final int Id_attribute- See Also:
-
Id_attributes
private static final int Id_attributes- See Also:
-
Id_child
private static final int Id_child- See Also:
-
Id_childIndex
private static final int Id_childIndex- See Also:
-
Id_children
private static final int Id_children- See Also:
-
Id_comments
private static final int Id_comments- See Also:
-
Id_contains
private static final int Id_contains- See Also:
-
Id_copy
private static final int Id_copy- See Also:
-
Id_descendants
private static final int Id_descendants- See Also:
-
Id_elements
private static final int Id_elements- See Also:
-
Id_inScopeNamespaces
private static final int Id_inScopeNamespaces- See Also:
-
Id_insertChildAfter
private static final int Id_insertChildAfter- See Also:
-
Id_insertChildBefore
private static final int Id_insertChildBefore- See Also:
-
Id_hasOwnProperty
private static final int Id_hasOwnProperty- See Also:
-
Id_hasComplexContent
private static final int Id_hasComplexContent- See Also:
-
Id_hasSimpleContent
private static final int Id_hasSimpleContent- See Also:
-
Id_length
private static final int Id_length- See Also:
-
Id_localName
private static final int Id_localName- See Also:
-
Id_name
private static final int Id_name- See Also:
-
Id_namespace
private static final int Id_namespace- See Also:
-
Id_namespaceDeclarations
private static final int Id_namespaceDeclarations- See Also:
-
Id_nodeKind
private static final int Id_nodeKind- See Also:
-
Id_normalize
private static final int Id_normalize- See Also:
-
Id_parent
private static final int Id_parent- See Also:
-
Id_prependChild
private static final int Id_prependChild- See Also:
-
Id_processingInstructions
private static final int Id_processingInstructions- See Also:
-
Id_propertyIsEnumerable
private static final int Id_propertyIsEnumerable- See Also:
-
Id_removeNamespace
private static final int Id_removeNamespace- See Also:
-
Id_replace
private static final int Id_replace- See Also:
-
Id_setChildren
private static final int Id_setChildren- See Also:
-
Id_setLocalName
private static final int Id_setLocalName- See Also:
-
Id_setName
private static final int Id_setName- See Also:
-
Id_setNamespace
private static final int Id_setNamespace- See Also:
-
Id_text
private static final int Id_text- See Also:
-
Id_toString
private static final int Id_toString- See Also:
-
Id_toSource
private static final int Id_toSource- See Also:
-
Id_toXMLString
private static final int Id_toXMLString- See Also:
-
Id_valueOf
private static final int Id_valueOf- See Also:
-
MAX_PROTOTYPE_ID
private static final int MAX_PROTOTYPE_ID- See Also:
-
-
Constructor Details
-
XMLObjectImpl
-
-
Method Details
-
initialize
-
isPrototype
final boolean isPrototype() -
getLib
XMLLibImpl getLib() -
newXML
-
xmlFromNode
-
newXMLList
-
newXMLListFrom
-
getProcessor
-
newQName
-
newQName
-
createNamespace
-
createNamespaces
-
getPrototype
Description copied from class:ScriptableObjectReturns the prototype of the object.- Specified by:
getPrototypein interfaceScriptable- Overrides:
getPrototypein classScriptableObject- Returns:
- the prototype
-
setPrototype
Description copied from class:ScriptableObjectSets the prototype of the object.- Specified by:
setPrototypein interfaceScriptable- Overrides:
setPrototypein classScriptableObject- Parameters:
prototype- the prototype to set
-
getParentScope
Description copied from class:ScriptableObjectReturns the parent (enclosing) scope of the object.- Specified by:
getParentScopein interfaceScriptable- Overrides:
getParentScopein classScriptableObject- Returns:
- the parent scope
-
setParentScope
Description copied from class:ScriptableObjectSets the parent (enclosing) scope of the object.- Specified by:
setParentScopein interfaceScriptable- Overrides:
setParentScopein classScriptableObject- Parameters:
parent- the parent scope to set
-
getDefaultValue
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.
-
hasInstance
Description copied from class:ScriptableObjectImplements the instanceof operator.This operator has been proposed to ECMA.
- Specified by:
hasInstancein interfaceScriptable- Overrides:
hasInstancein classScriptableObject- Parameters:
scriptable- The value that appeared on the LHS of the instanceof operator- Returns:
- true if "this" appears in value's prototype chain
-
hasXMLProperty
ecmaHas(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index. -
getXMLProperty
-
putXMLProperty
-
deleteXMLProperty
ecmaDelete(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index. -
equivalentXml
Test XML equality with target the target. -
addMatches
-
getMatches
-
getXML
-
child
-
child
-
children
-
comments
-
contains
-
copy
-
elements
-
hasOwnProperty
-
hasComplexContent
abstract boolean hasComplexContent() -
hasSimpleContent
abstract boolean hasSimpleContent() -
length
abstract int length() -
normalize
abstract void normalize() -
parent
-
processingInstructions
-
propertyIsEnumerable
-
text
-
toString
-
toSource
-
toXMLString
-
valueOf
-
jsConstructor
-
equivalentValues
XMLObject always compare with any value and equivalentValues never returnsScriptable.NOT_FOUNDfor them but rather calls equivalentXml(value) and wrap the result as Boolean.- Overrides:
equivalentValuesin classScriptableObject
-
has
-
has
Description copied from class:ScriptableObjectReturns true if the named property is defined.- Specified by:
hasin interfaceScriptable- Overrides:
hasin classIdScriptableObject- Parameters:
name- the name of the propertystart- the object in which the lookup began- Returns:
- true if and only if the property was found in the object
- See Also:
-
get
-
get
Description copied from class:ScriptableObjectReturns the value of the named property or NOT_FOUND.If the property was created using defineProperty, the appropriate getter method is called.
- Specified by:
getin interfaceScriptable- Overrides:
getin classIdScriptableObject- Parameters:
name- the name of the propertystart- the object in which the lookup began- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
-
put
-
put
Description copied from class:ScriptableObjectSets the value of the named property, creating it if need be.If the property was created using defineProperty, the appropriate setter method is called.
If the property's attributes include READONLY, no action is taken. This method will actually set the property in the start object.
- Specified by:
putin interfaceScriptable- Overrides:
putin classIdScriptableObject- Parameters:
name- the name of the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
-
delete
-
delete
Description copied from class:ScriptableObjectRemoves a named property from the object.If the property is not found, or it has the PERMANENT attribute, no action is taken.
- Specified by:
deletein interfaceScriptable- Overrides:
deletein classIdScriptableObject- Parameters:
name- the name of the property- See Also:
-
getFunctionProperty
- Specified by:
getFunctionPropertyin classXMLObject
-
getFunctionProperty
- Specified by:
getFunctionPropertyin classXMLObject
-
memberRef
-
memberRef
-
enterWith
Description copied from class:XMLObjectWrap this object into NativeWith to implement the with statement. -
enterDotQuery
Description copied from class:XMLObjectWrap this object into NativeWith to implement the .() query.- Specified by:
enterDotQueryin classXMLObject
-
addValues
Description copied from class:XMLObjectCustom+operator. Should returnScriptable.NOT_FOUNDif this object does not have custom addition operator for the given value, or the result of the addition operation.The default implementation returns
Scriptable.NOT_FOUNDto indicate no custom addition operation. -
exportAsJSClass
final void exportAsJSClass(boolean sealed) -
findPrototypeId
- Overrides:
findPrototypeIdin classIdScriptableObject
-
initPrototypeId
protected void initPrototypeId(int id) - Overrides:
initPrototypeIdin classIdScriptableObject
-
toObjectArray
-
xmlMethodNotFound
-
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:
execIdCallin interfaceIdFunctionCall- Overrides:
execIdCallin classIdScriptableObject
-
arg
-
newTextElementXML
-
newXMLFromJs
-
ecmaToXml
-
ecmaEscapeAttributeValue
-
createEmptyXML
-