Class XMLObjectImpl

    • Method Detail

      • isPrototype

        final boolean isPrototype()
      • newXMLList

        final XMLList newXMLList()
      • newXMLListFrom

        final XMLList newXMLListFrom​(java.lang.Object o)
      • newQName

        final QName newQName​(java.lang.String uri,
                             java.lang.String localName,
                             java.lang.String prefix)
      • getDefaultValue

        public final 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 interface Scriptable
        Overrides:
        getDefaultValue in class ScriptableObject
        Parameters:
        hint - the type hint
        Returns:
        the default value for the object See ECMA 8.6.2.6.
      • hasInstance

        public final boolean hasInstance​(Scriptable scriptable)
        Description copied from class: ScriptableObject
        Implements the instanceof operator.

        This operator has been proposed to ECMA.

        Specified by:
        hasInstance in interface Scriptable
        Overrides:
        hasInstance in class ScriptableObject
        Parameters:
        scriptable - The value that appeared on the LHS of the instanceof operator
        Returns:
        true if "this" appears in value's prototype chain
      • hasXMLProperty

        abstract boolean hasXMLProperty​(XMLName name)
        ecmaHas(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.
      • getXMLProperty

        abstract java.lang.Object getXMLProperty​(XMLName name)
        ecmaGet(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.
      • putXMLProperty

        abstract void putXMLProperty​(XMLName name,
                                     java.lang.Object value)
        ecmaPut(cx, id, value) calls this after resolving when id to XMLName and checking it is not Uint32 index.
      • deleteXMLProperty

        abstract void deleteXMLProperty​(XMLName name)
        ecmaDelete(cx, id) calls this after resolving when id to XMLName and checking it is not Uint32 index.
      • equivalentXml

        abstract boolean equivalentXml​(java.lang.Object target)
        Test XML equality with target the target.
      • addMatches

        abstract void addMatches​(XMLList rv,
                                 XMLName name)
      • getXML

        abstract XML getXML()
      • child

        abstract XMLList child​(int index)
      • children

        abstract XMLList children()
      • comments

        abstract XMLList comments()
      • contains

        abstract boolean contains​(java.lang.Object xml)
      • hasOwnProperty

        abstract boolean hasOwnProperty​(XMLName xmlName)
      • hasComplexContent

        abstract boolean hasComplexContent()
      • hasSimpleContent

        abstract boolean hasSimpleContent()
      • length

        abstract int length()
      • normalize

        abstract void normalize()
      • parent

        abstract java.lang.Object parent()
      • processingInstructions

        abstract XMLList processingInstructions​(XMLName xmlName)
      • propertyIsEnumerable

        abstract boolean propertyIsEnumerable​(java.lang.Object member)
      • toString

        public abstract java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toSource

        abstract java.lang.String toSource​(int indent)
      • toXMLString

        abstract java.lang.String toXMLString()
      • valueOf

        abstract java.lang.Object valueOf()
      • jsConstructor

        protected abstract java.lang.Object jsConstructor​(Context cx,
                                                          boolean inNewExpr,
                                                          java.lang.Object[] args)
      • equivalentValues

        protected final java.lang.Object equivalentValues​(java.lang.Object value)
        XMLObject always compare with any value and equivalentValues never returns Scriptable.NOT_FOUND for them but rather calls equivalentXml(value) and wrap the result as Boolean.
        Overrides:
        equivalentValues in class ScriptableObject
      • has

        public final boolean has​(Context cx,
                                 java.lang.Object id)
        Implementation of ECMAScript [[Has]]
        Specified by:
        has in class XMLObject
      • get

        public final java.lang.Object get​(Context cx,
                                          java.lang.Object id)
        Implementation of ECMAScript [[Get]]
        Specified by:
        get in class XMLObject
      • get

        public java.lang.Object get​(java.lang.String name,
                                    Scriptable start)
        Description copied from class: ScriptableObject
        Returns the value of the named property or NOT_FOUND. If the property was created using defineProperty, the appropriate getter method is called.
        Specified by:
        get in interface Scriptable
        Overrides:
        get in class IdScriptableObject
        Parameters:
        name - the name of the property
        start - the object in which the lookup began
        Returns:
        the value of the property (may be null), or NOT_FOUND
        See Also:
        Context.getUndefinedValue()
      • put

        public final void put​(Context cx,
                              java.lang.Object id,
                              java.lang.Object value)
        Implementation of ECMAScript [[Put]]
        Specified by:
        put in class XMLObject
      • delete

        public final boolean delete​(Context cx,
                                    java.lang.Object id)
        Implementation of ECMAScript [[Delete]].
        Specified by:
        delete in class XMLObject
      • memberRef

        public Ref memberRef​(Context cx,
                             java.lang.Object elem,
                             int memberTypeFlags)
        Description copied from class: XMLObject
        Generic reference to implement x.@y, x..y etc.
        Specified by:
        memberRef in class XMLObject
      • memberRef

        public Ref memberRef​(Context cx,
                             java.lang.Object namespace,
                             java.lang.Object elem,
                             int memberTypeFlags)
        Generic reference to implement x::ns, x.@ns::y, x..@ns::y etc.
        Specified by:
        memberRef in class XMLObject
      • addValues

        public final java.lang.Object addValues​(Context cx,
                                                boolean thisIsLeft,
                                                java.lang.Object value)
        Description copied from class: XMLObject
        Custom + operator. Should return Scriptable.NOT_FOUND if 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_FOUND to indicate no custom addition operation.

        Overrides:
        addValues in class XMLObject
        Parameters:
        cx - the Context object associated with the current thread.
        thisIsLeft - if true, the object should calculate this + value if false, the object should calculate value + this.
        value - the second argument for addition operation.
      • exportAsJSClass

        final void exportAsJSClass​(boolean sealed)
      • toObjectArray

        private java.lang.Object[] toObjectArray​(java.lang.Object[] typed)
      • xmlMethodNotFound

        private void xmlMethodNotFound​(java.lang.Object object,
                                       java.lang.String name)
      • arg

        private static java.lang.Object arg​(java.lang.Object[] args,
                                            int i)
      • newTextElementXML

        final XML newTextElementXML​(XmlNode reference,
                                    XmlNode.QName qname,
                                    java.lang.String value)
      • newXMLFromJs

        final XML newXMLFromJs​(java.lang.Object inputObject)
      • ecmaToXml

        final XML ecmaToXml​(java.lang.Object object)
      • ecmaEscapeAttributeValue

        final java.lang.String ecmaEscapeAttributeValue​(java.lang.String s)
      • createEmptyXML

        final XML createEmptyXML()