Unicorn XML Toolkit
Version 1.00.00

Namespace EcmaScriptXml
Class CBaseObject

class CBaseObject: public CNativeObject {
public:
    CBaseObject(
        CXmlObject *pXmlObject,
        const XObject &pPrototype);
    ~CBaseObject();
public:
    CXmlObject *GetXmlObject();
public:
    virtual Sax::XAttributes GetAttributes();
    virtual Sax::XAttributesImpl GetAttributesImpl();
    virtual Sax::XContentHandler GetContentHandler();
    virtual Sax::XDtdHandler GetDtdHandler();
    virtual Sax::XEntityResolver GetEntityResolver();
    virtual Sax::XErrorHandler GetErrorHandler();
    virtual Sax::XInputSource GetInputSource();
    virtual Sax::XLocator GetLocator();
    virtual Sax::XLocatorImpl GetLocatorImpl();
    virtual Sax::XNamespaceSupport GetNamespaceSupport();
    virtual Sax::XEnumeration GetEnumeration();
    virtual Sax::CSaxException *GetException();
    virtual Sax::CSaxParseException *GetParseException();
    virtual Sax::XXmlStream GetStream();
    virtual Sax::XXmlProcessor GetProcessor();
    virtual Sax::XXmlReader GetReader();
    virtual Sax::XXmlFilterImpl GetFilterImpl();
public:
    virtual Sax::XContentHandler WrapContentHandler();
    virtual Sax::XDtdHandler WrapDtdHandler();
    virtual Sax::XEntityResolver WrapEntityResolver();
    virtual Sax::XErrorHandler WrapErrorHandler();
    virtual Sax::XXmlStream WrapStream();
    };

The base class for XML extension objects.

Declaration of this class is made public in order to allow development of custom ECMAScript extensions, which provide objects, derived from XML content handlers, XML streams, or XML processors (that is, objects, containing XML ContentHandler prototype, Stream prototype, or Processor prototype in their prototype chains and thus implementing properties of corresponding XML extension objects).

Each ECMAScript XML extension object may be associated with an instance of the appropriate class defined in Sax namespace; in this case function properties of the XML extension object are initially bound to the event processing functions of the associated SAX object instance. If the associated SAX object is not specified, the event processing function properties are bound to the appropriate defaults (represented by void functions in most cases). Function members of CBaseObject having names started with "Get" provide access to SAX object instances associated with ECMAScript XML extension objects, or NULL if none was specified.

Some XML extension object classes allow event processing function properties being overriden by ECMAScript programs. If any of these functions are overridden, SAX event processing provided by the ECMAScript object may be different from that of the associated SAX object instance. Function members of CBaseObject having names started with "Wrap" return instances of Sax classes, which wrap event processing ECMAScript function properties associated with given XML extension objects.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CXmlObject, EcmaScript::CObject, Sax::CAttributes, Sax::CAttributesImpl, Sax::CContentHandler, Sax::CDtdHandler, Sax::CEntityResolver, Sax::CErrorHandler, Sax::CInputSource, Sax::CLocator, Sax::CLocatorImpl, Sax::CNamepaceSupport, Sax::CEnumeration, Sax::CSaxException, Sax::CSaxParseException, Sax::CXmlStream, Sax::CXmlProcessor, Sax::CXmlReader, Sax::CXmlFilterImpl
Constructor/Destructor Summary
CBaseObject (CXmlObject *pXmlObject, const XObject &pPrototype);
����������Constructs the object.
~CBaseObject ();
����������Destroys the object.

Function Summary
CXmlObject�* GetXmlObject ();
����������Returns the XML root object associated with this object.
Sax::XAttributes GetAttributes ();
����������Returns an instance of Sax::CAttributes associated with this object, if this object represents SAX attributes (that is, its prototype chain contains the Attributes prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XAttributesImpl GetAttributesImpl ();
����������Returns an instance of Sax::CAttributesImpl associated with this object, if this object represents SAX attributes (that is, its prototype chain contains the Attributes prototype) and is implemented using Sax::CAttributesImpl class; otherwise, throws the CEcmaScriptXmlException .
Sax::XContentHandler GetContentHandler ();
����������Returns an instance of Sax::CContentHandler associated with this object, if this object represents a SAX content handler (that is, its prototype chain contains the ContentHandler prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XDtdHandler GetDtdHandler ();
����������Returns an instance of Sax::CDtdHandler associated with this object, if this object represents a SAX DTD handler (that is, its prototype chain contains the DTDHandler prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XEntityResolver GetEntityResolver ();
����������Returns an instance of Sax::CEntityResolver associated with this object, if this object represents a SAX entity resolver (that is, its prototype chain contains the EntityResolver prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XErrorHandler GetErrorHandler ();
����������Returns an instance of Sax::CErrorHandler associated with this object, if this object represents a SAX error handler (that is, its prototype chain contains the ErrorHandler prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XInputSource GetInputSource ();
����������Returns an instance of Sax::CInputSource associated with this object, if this object represents a SAX input source (that is, its prototype chain contains the InputSource prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XLocator GetLocator ();
����������Returns an instance of Sax::CLocator associated with this object, if this object represents a SAX locator (that is, its prototype chain contains the Locator prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XLocatorImpl GetLocatorImpl ();
����������Returns an instance of Sax::CLocatorImpl associated with this object, if this object represents a SAX locator (that is, its prototype chain contains the Locator prototype) and is implemented using Sax::CLocatorImpl class; otherwise, throws the CEcmaScriptXmlException .
Sax::XNamespaceSupport GetNamespaceSupport ();
����������Returns an instance of Sax::CNamespaceSupport associated with this object, if this object represents SAX namespace support (that is, its prototype chain contains the NamespaceSupport prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XEnumeration GetEnumeration ();
����������Returns an instance of Sax::CEnumeration associated with this object, if this object represents a SAX enumeration (that is, its prototype chain contains the Enumeration prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::CSaxException�* GetException ();
����������Returns an instance of Sax::CSaxException associated with this object, if this object represents a SAX exception (that is, its prototype chain contains the Exception prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::CSaxParseException�* GetParseException ();
����������Returns an instance of Sax::CSaxParseException associated with this object, if this object represents a SAX parse exception (that is, its prototype chain contains the ParseException prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XXmlStream GetStream ();
����������Returns an instance of Sax::CXmlStream associated with this object, if this object represents an XML stream (that is, its prototype chain contains the Stream prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XXmlProcessor GetProcessor ();
����������Returns an instance of Sax::CXmlProcessor associated with this object, if this object represents an XML processor (that is, its prototype chain contains the Processor prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XXmlReader GetReader ();
����������Returns an instance of Sax::CXmlReader associated with this object, if this object represents a SAX reader (that is, its prototype chain contains the Reader prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XXmlFilterImpl GetFilterImpl ();
����������Returns an instance of Sax::CXmlFilterImpl associated with this object, if this object represents a SAX filter implementation (that is, its prototype chain contains the Filter prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XContentHandler WrapContentHandler ();
����������Returns an instance of Sax::CContentHandler , which wraps event processing ECMAScript function properties associated with this object, if this object represents a SAX content handler (that is, its prototype chain contains the ContentHandler prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XDtdHandler WrapDtdHandler ();
����������Returns an instance of Sax::CDtdHandler , which wraps event processing ECMAScript function properties associated with this object, if this object represents a SAX DTD handler (that is, its prototype chain contains the DTDHandler prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XEntityResolver WrapEntityResolver ();
����������Returns an instance of Sax::CEntityResolver , which wraps event processing ECMAScript function properties associated with this object, if this object represents a SAX entity resolver (that is, its prototype chain contains the EntityResolver prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XErrorHandler WrapErrorHandler ();
����������Returns an instance of Sax::CErrorHandler , which wraps event processing ECMAScript function properties associated with this object, if this object represents a SAX erorr handler (that is, its prototype chain contains the ErrorHandler prototype); otherwise, throws the CEcmaScriptXmlException .
Sax::XXmlStream WrapStream ();
����������Returns an instance of Sax::CXmlStream , which wraps event processing ECMAScript function properties associated with this object, if this object represents an XML stream (that is, its prototype chain contains the Stream prototype); otherwise, throws the CEcmaScriptXmlException .

Constructor/Destructor Detail

CBaseObject

CBaseObject(
    CXmlObject *pXmlObject,
    const XObject &pPrototype);

Constructs the object.

Parameters:
pXmlObject - the XML root object
pPrototype - the object's prototype (value of the internal [[Prototype]] property for this object)

~CBaseObject

~CBaseObject();

Destroys the object.

Function Detail

GetXmlObject

CXmlObject *GetXmlObject();

Returns the XML root object associated with this object.

Returns:
the XML root object associated with this object

GetAttributes

virtual Sax::XAttributes GetAttributes();

Returns an instance of Sax::CAttributes associated with this object, if this object represents SAX attributes (that is, its prototype chain contains the Attributes prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX attributes instance associated with this object

GetAttributesImpl

virtual Sax::XAttributesImpl GetAttributesImpl();

Returns an instance of Sax::CAttributesImpl associated with this object, if this object represents SAX attributes (that is, its prototype chain contains the Attributes prototype) and is implemented using Sax::CAttributesImpl class; otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX attributes implementation instance associated with this object

GetContentHandler

virtual Sax::XContentHandler GetContentHandler();

Returns an instance of Sax::CContentHandler associated with this object, if this object represents a SAX content handler (that is, its prototype chain contains the ContentHandler prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX content handler instance associated with this object

GetDtdHandler

virtual Sax::XDtdHandler GetDtdHandler();

Returns an instance of Sax::CDtdHandler associated with this object, if this object represents a SAX DTD handler (that is, its prototype chain contains the DTDHandler prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX DTD handler instance associated with this object

GetEntityResolver

virtual Sax::XEntityResolver GetEntityResolver();

Returns an instance of Sax::CEntityResolver associated with this object, if this object represents a SAX entity resolver (that is, its prototype chain contains the EntityResolver prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX entity resolver instance associated with this object

GetErrorHandler

virtual Sax::XErrorHandler GetErrorHandler();

Returns an instance of Sax::CErrorHandler associated with this object, if this object represents a SAX error handler (that is, its prototype chain contains the ErrorHandler prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX error handler instance associated with this object

GetInputSource

virtual Sax::XInputSource GetInputSource();

Returns an instance of Sax::CInputSource associated with this object, if this object represents a SAX input source (that is, its prototype chain contains the InputSource prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX input source instance associated with this object

GetLocator

virtual Sax::XLocator GetLocator();

Returns an instance of Sax::CLocator associated with this object, if this object represents a SAX locator (that is, its prototype chain contains the Locator prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX locator instance associated with this object

GetLocatorImpl

virtual Sax::XLocatorImpl GetLocatorImpl();

Returns an instance of Sax::CLocatorImpl associated with this object, if this object represents a SAX locator (that is, its prototype chain contains the Locator prototype) and is implemented using Sax::CLocatorImpl class; otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX locator implementation instance associated with this object

GetNamespaceSupport

virtual Sax::XNamespaceSupport GetNamespaceSupport();

Returns an instance of Sax::CNamespaceSupport associated with this object, if this object represents SAX namespace support (that is, its prototype chain contains the NamespaceSupport prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX namespace support instance associated with this object

GetEnumeration

virtual Sax::XEnumeration GetEnumeration();

Returns an instance of Sax::CEnumeration associated with this object, if this object represents a SAX enumeration (that is, its prototype chain contains the Enumeration prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX enumeration instance associated with this object

GetException

virtual Sax::CSaxException *GetException();

Returns an instance of Sax::CSaxException associated with this object, if this object represents a SAX exception (that is, its prototype chain contains the Exception prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX exception instance associated with this object

GetParseException

virtual Sax::CSaxParseException *GetParseException();

Returns an instance of Sax::CSaxParseException associated with this object, if this object represents a SAX parse exception (that is, its prototype chain contains the ParseException prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX parse exception instance associated with this object

GetStream

virtual Sax::XXmlStream GetStream();

Returns an instance of Sax::CXmlStream associated with this object, if this object represents an XML stream (that is, its prototype chain contains the Stream prototype); otherwise, throws the CEcmaScriptXmlException .

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

GetProcessor

virtual Sax::XXmlProcessor GetProcessor();

Returns an instance of Sax::CXmlProcessor associated with this object, if this object represents an XML processor (that is, its prototype chain contains the Processor prototype); otherwise, throws the CEcmaScriptXmlException .

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

GetReader

virtual Sax::XXmlReader GetReader();

Returns an instance of Sax::CXmlReader associated with this object, if this object represents a SAX reader (that is, its prototype chain contains the Reader prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX reader instance associated with this object

GetFilterImpl

virtual Sax::XXmlFilterImpl GetFilterImpl();

Returns an instance of Sax::CXmlFilterImpl associated with this object, if this object represents a SAX filter implementation (that is, its prototype chain contains the Filter prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX filter implementation instance associated with this object

WrapContentHandler

virtual Sax::XContentHandler WrapContentHandler();

Returns an instance of Sax::CContentHandler , which wraps event processing ECMAScript function properties associated with this object, if this object represents a SAX content handler (that is, its prototype chain contains the ContentHandler prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX content handler instance, which wraps event processing ECMAScript function properties associated with this object

WrapDtdHandler

virtual Sax::XDtdHandler WrapDtdHandler();

Returns an instance of Sax::CDtdHandler , which wraps event processing ECMAScript function properties associated with this object, if this object represents a SAX DTD handler (that is, its prototype chain contains the DTDHandler prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX DTD handler instance, which wraps event processing ECMAScript function properties associated with this object

WrapEntityResolver

virtual Sax::XEntityResolver WrapEntityResolver();

Returns an instance of Sax::CEntityResolver , which wraps event processing ECMAScript function properties associated with this object, if this object represents a SAX entity resolver (that is, its prototype chain contains the EntityResolver prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX entity resolver instance, which wraps event processing ECMAScript function properties associated with this object

WrapErrorHandler

virtual Sax::XErrorHandler WrapErrorHandler();

Returns an instance of Sax::CErrorHandler , which wraps event processing ECMAScript function properties associated with this object, if this object represents a SAX erorr handler (that is, its prototype chain contains the ErrorHandler prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the SAX error handler instance, which wraps event processing ECMAScript function properties associated with this object

WrapStream

virtual Sax::XXmlStream WrapStream();

Returns an instance of Sax::CXmlStream , which wraps event processing ECMAScript function properties associated with this object, if this object represents an XML stream (that is, its prototype chain contains the Stream prototype); otherwise, throws the CEcmaScriptXmlException .

Returns:
the Sax::CXmlStream instance, which wraps event processing ECMAScript function properties 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.