Unicorn XML Toolkit
Version 1.00.00

Namespace EcmaScriptXml
Class CProcessorInstance

class CProcessorInstance: public CStreamInstance {
public:
    CProcessorInstance(
        CXmlObject *pXmlObject,
        const XObject &pPrototype,
        const Sax::XXmlProcessor &pProcessor=NULL);
    ~CProcessorInstance();
public:
    CString Class();
public:
    XValue GetProperty(
        CContext &context,
        int nSelector);
    void PutProperty(
        CContext &context,
        int nSelector,
        const XValue &pValue);
public:
    Sax::XXmlProcessor GetProcessor();
    };

The ECMAScript object representing an XML Processor instance.

Declaration of this class is made public in order to allow development of custom ECMAScript extensions, which provide objects, derived from XML processors, (that is, objects, containing XML Processor prototype in their prototype chains and thus implementing properties of XML processors). Instances of such extension objects must be implemented using classes derived from CProcessorInstance .

Each ECMAScript processor instance may be associated with an object of Sax::CXmlProcessor class; in this case function properties of the XML extension object are initially bound to event processing functions of the associated Sax::CXmlProcessor instance.

If the associated Sax::CXmlProcessor instance is not specified, then the internal Sax::CXmlProcessor object is automatically generated and associated with this ECMAScript processor instance. This internal object wraps event processing ECMAScript function properties which are defined on this ECMAScript processor instance.

Some XML processor object classes allow event processing function properties being overriden by ECMAScript programs in order to implement custom event processing.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CXmlObject, EcmaScript::CValue, EcmaScript::CObject, EcmaScript::CContext, Sax::CXmlProcessor
Constructor/Destructor Summary
CProcessorInstance (CXmlObject *pXmlObject, const XObject &pPrototype, const Sax::XXmlProcessor &pProcessor=NULL);
����������Constructs the XML processor instance.
~CProcessorInstance ();
����������Destroys the XML processor instance.

Function Summary
CString Class ();
����������Returns the value of the internal [[Class]] property of this object.
XValue GetProperty (CContext &context, int nSelector);
����������Returns value of the property corresponding to the specified selector.
void PutProperty (CContext &context, int nSelector, const XValue &pValue);
����������Assigns value to the property with the specified selector.
Sax::XXmlProcessor GetProcessor ();
����������Returns an instance of Sax::CXmlProcessor associated with this object.

Constructor/Destructor Detail

CProcessorInstance

CProcessorInstance(
    CXmlObject *pXmlObject,
    const XObject &pPrototype,
    const Sax::XXmlProcessor &pProcessor=NULL);

Constructs the XML processor instance.

Parameters:
pXmlObject - the XML root object
pPrototype - the object's prototype (value of the internal [[Prototype]] property for this object)
pProcessor - the instance of the XML processor for this object; NULL if not specified

~CProcessorInstance

~CProcessorInstance();

Destroys the XML processor instance.

Function Detail

Class

CString Class();

Returns the value of the internal [[Class]] property of this object.

This function returns "XML.Processor" . It may be (and usually is) overriden by derived classes.

Returns:
the value of the internal [[Class]] property of this object

GetProperty

XValue GetProperty(
    CContext &context,
    int nSelector);

Returns value of the property corresponding to the specified selector.

Parameters:
context - the execution context
nSelector - the selector
Returns:
value of the property corresponding to the specified selector

PutProperty

void PutProperty(
    CContext &context,
    int nSelector,
    const XValue &pValue);

Assigns value to the property with the specified selector.

Parameters:
context - the execution context
nSelector - the selector
pValue - value to assign

GetProcessor

Sax::XXmlProcessor GetProcessor();

Returns an instance of Sax::CXmlProcessor associated with this object.

If no Sax::CXmlProcessor was specified at the construction time, the automatically created internal object is returned.

Returns:
the Sax::CXmlProcessor instance associated with this object

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.