Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Friends | List of all members
XObject Class Referenceabstract

Class to hold XPath return types. More...

Inheritance diagram for XObject:
XalanReferenceCountedObject XBoolean XNodeSetBase XNull XNumberBase XResultTreeFrag XStringBase XToken XUnknown

Classes

class  XObjectException
 
class  XObjectInvalidConversionException
 

Public Types

enum  eObjectType {
  eTypeNull = 0, eTypeUnknown = 1, eTypeBoolean = 2, eTypeNumber = 3,
  eTypeString = 4, eTypeNodeSet = 5, eTypeResultTreeFrag = 6, eTypeUserDefined = 7,
  eTypeStringReference = 8, eTypeStringAdapter = 9, eTypeStringCached = 10, eTypeXTokenNumberAdapter = 11,
  eTypeXTokenStringAdapter = 12, eTypeNodeSetNodeProxy = 13, eUnknown
}
 Enumeration of possible object types. More...
 
typedef void(FormatterListener::* MemberFunctionPtr )(const XMLCh *const, const unsigned int)
 

Public Member Functions

 XObject (eObjectType theObjectType)
 Create an XObject. More...
 
 XObject (const XObject &source)
 
virtual const XalanDOMStringgetTypeString () const =0
 Given a request type, return the equivalent string. More...
 
virtual double num () const
 Cast result object to a number. More...
 
virtual bool boolean () const
 Cast result object to a boolean. More...
 
virtual const XalanDOMStringstr () const
 Cast result object to a string. More...
 
virtual void str (FormatterListener &formatterListener, MemberFunctionPtr function) const =0
 Send the string value to a FormatterListener instance. More...
 
virtual double stringLength () const =0
 Get the length of the string value of the instance. More...
 
virtual void str (XalanDOMString &theBuffer) const
 Append the string value directly a string. More...
 
virtual const
XalanDocumentFragment
rtree () const
 Cast result object to a result tree fragment. More...
 
virtual const NodeRefListBasenodeset () const
 Cast result object to a nodelist. More...
 
virtual void ProcessXObjectTypeCallback (XObjectTypeCallback &theCallbackObject)=0
 Process a callback request for preferred type information. More...
 
virtual void ProcessXObjectTypeCallback (XObjectTypeCallback &theCallbackObject) const =0
 Process a callback request for preferred type information. More...
 
bool equals (const XObject &theRHS, XPathExecutionContext &executionContext) const
 Tell if two objects are functionally equal. More...
 
bool notEquals (const XObject &theRHS, XPathExecutionContext &executionContext) const
 Tell if two objects are functionally not equal. More...
 
bool lessThan (const XObject &theRHS, XPathExecutionContext &executionContext) const
 Tell if one object is less than the other. More...
 
bool lessThanOrEquals (const XObject &theRHS, XPathExecutionContext &executionContext) const
 Tell if one object is less than or equal the other. More...
 
bool greaterThan (const XObject &theRHS, XPathExecutionContext &executionContext) const
 Tell if one object is greater than the other. More...
 
bool greaterThanOrEquals (const XObject &theRHS, XPathExecutionContext &executionContext) const
 Tell if one object is greater than or equal the other. More...
 
eObjectType getType () const
 Tell what kind of class this is. More...
 
void setFactory (XObjectFactory *theFactory)
 

Static Public Member Functions

static void initialize (MemoryManagerType &theManager)
 Perform static initialization. More...
 
static void terminate ()
 Perform static shut down. More...
 
static bool boolean (double theNumber)
 Static conversion function. More...
 
static bool boolean (const XalanDOMString &theString)
 Static conversion function. More...
 
static bool boolean (const NodeRefListBase &theNodeList)
 Static conversion function. More...
 
static const XalanDOMStringstring (bool theBool)
 Static conversion function. More...
 
static void string (bool theBool, FormatterListener &formatterListener, MemberFunctionPtr function)
 
static void string (double theNumber, XalanDOMString &theString)
 Static conversion function. More...
 
static void string (double theNumber, FormatterListener &formatterListener, MemberFunctionPtr function)
 
static void string (const XalanNode &theNode, XalanDOMString &theString)
 Static conversion function. More...
 
static void string (const XalanNode &theNode, FormatterListener &formatterListener, MemberFunctionPtr function)
 
static void string (const NodeRefListBase &theNodeList, XalanDOMString &theString)
 Static conversion function. More...
 
static void string (const NodeRefListBase &theNodeList, FormatterListener &formatterListener, MemberFunctionPtr function)
 
static double number (bool theBoolean)
 Static conversion function. More...
 
static double number (const XalanDOMString &theString, MemoryManagerType &theManager)
 
static double number (XPathExecutionContext &executionContext, const NodeRefListBase &theNodeList)
 Static conversion function. More...
 
static double number (XPathExecutionContext &executionContext, const XalanNode &theNode)
 Static conversion function. More...
 

Protected Member Functions

virtual eObjectType getRealType () const
 Tell what kind of class this is. More...
 
virtual void referenced ()
 
virtual void dereferenced ()
 
virtual ~XObject ()
 
- Protected Member Functions inherited from XalanReferenceCountedObject
 XalanReferenceCountedObject ()
 Create a XalanReferenceCountedObject. More...
 
virtual ~XalanReferenceCountedObject ()
 
virtual unsigned int getReferenceCount () const
 

Static Protected Attributes

static const XalanDOMString s_emptyString
 
static const XalanDOMStrings_booleanString
 
static const XalanDOMStrings_falseString
 
static const XalanDOMStrings_nodesetString
 
static const XalanDOMStrings_numberString
 
static const XalanDOMStrings_resultTreeFragmentString
 
static const XalanDOMStrings_stringString
 
static const XalanDOMStrings_trueString
 

Friends

class XObjectPtr
 
class XObjectFactory
 

Additional Inherited Members

- Static Protected Member Functions inherited from XalanReferenceCountedObject
static void addReference (XalanReferenceCountedObject *theInstance)
 Increment reference count. More...
 
static void removeReference (XalanReferenceCountedObject *theInstance)
 Decrement reference count. More...
 

Detailed Description

Class to hold XPath return types.

Member Typedef Documentation

typedef void(FormatterListener::* XObject::MemberFunctionPtr)(const XMLCh *const, const unsigned int)

Member Enumeration Documentation

Enumeration of possible object types.

Enumerator
eTypeNull 
eTypeUnknown 
eTypeBoolean 
eTypeNumber 
eTypeString 
eTypeNodeSet 
eTypeResultTreeFrag 
eTypeUserDefined 
eTypeStringReference 
eTypeStringAdapter 
eTypeStringCached 
eTypeXTokenNumberAdapter 
eTypeXTokenStringAdapter 
eTypeNodeSetNodeProxy 
eUnknown 

Constructor & Destructor Documentation

XObject::XObject ( eObjectType  theObjectType)

Create an XObject.

Parameters
theObjectTypeThe enum for the type of the object.
XObject::XObject ( const XObject source)
virtual XObject::~XObject ( )
protectedvirtual

Member Function Documentation

virtual bool XObject::boolean ( ) const
virtual

Cast result object to a boolean.

Returns
boolean value

Reimplemented in XResultTreeFrag, XNull, XUnknown, XStringBase, XToken, XNodeSetBase, XBoolean, and XNumberBase.

static bool XObject::boolean ( double  theNumber)
static

Static conversion function.

Returns
bool value
static bool XObject::boolean ( const XalanDOMString theString)
static

Static conversion function.

Returns
bool value
static bool XObject::boolean ( const NodeRefListBase theNodeList)
static

Static conversion function.

Returns
bool value
virtual void XObject::dereferenced ( )
protectedvirtual

Implements XalanReferenceCountedObject.

Reimplemented in XResultTreeFrag, and XToken.

bool XObject::equals ( const XObject theRHS,
XPathExecutionContext executionContext 
) const

Tell if two objects are functionally equal.

Parameters
theRHSobject to compare
executionContextthe current execution context
Returns
true if they are equal
virtual eObjectType XObject::getRealType ( ) const
protectedvirtual

Tell what kind of class this is.

Returns
numeric type value

Reimplemented in XNodeSetNodeProxy, XTokenStringAdapter, XStringCached, XTokenNumberAdapter, XStringReference, and XStringAdapter.

eObjectType XObject::getType ( ) const

Tell what kind of class this is.

Returns
numeric type value
virtual const XalanDOMString& XObject::getTypeString ( ) const
pure virtual

Given a request type, return the equivalent string.

For diagnostic purposes.

Returns
string for type

Implemented in XResultTreeFrag, XNull, XUnknown, XStringBase, XToken, XNodeSetBase, XBoolean, and XNumberBase.

bool XObject::greaterThan ( const XObject theRHS,
XPathExecutionContext executionContext 
) const

Tell if one object is greater than the other.

Parameters
theRHSobject to compare
Returns
true if they are equal
bool XObject::greaterThanOrEquals ( const XObject theRHS,
XPathExecutionContext executionContext 
) const

Tell if one object is greater than or equal the other.

Parameters
theRHSobject to compare
Returns
true if they are equal
static void XObject::initialize ( MemoryManagerType theManager)
static

Perform static initialization.

See class XPathInit.

bool XObject::lessThan ( const XObject theRHS,
XPathExecutionContext executionContext 
) const

Tell if one object is less than the other.

Parameters
theRHSobject to compare
Returns
true if they are equal
bool XObject::lessThanOrEquals ( const XObject theRHS,
XPathExecutionContext executionContext 
) const

Tell if one object is less than or equal the other.

Parameters
theRHSobject to compare
Returns
true if they are equal
virtual const NodeRefListBase& XObject::nodeset ( ) const
virtual

Cast result object to a nodelist.

Returns
node list

Reimplemented in XResultTreeFrag, XNodeSetBase, XNodeSet, and XNodeSetNodeProxy.

bool XObject::notEquals ( const XObject theRHS,
XPathExecutionContext executionContext 
) const

Tell if two objects are functionally not equal.

Parameters
theRHSobject to compare
executionContextthe current execution context
Returns
true if they are equal
virtual double XObject::num ( ) const
virtual

Cast result object to a number.

Returns
numeric value

Reimplemented in XResultTreeFrag, XNull, XUnknown, XStringBase, XToken, XNodeSetBase, XTokenStringAdapter, XTokenNumberAdapter, XBoolean, XNumber, and XNumberBase.

static double XObject::number ( bool  theBoolean)
static

Static conversion function.

Returns
bool value
static double XObject::number ( const XalanDOMString theString,
MemoryManagerType theManager 
)
static
static double XObject::number ( XPathExecutionContext executionContext,
const NodeRefListBase theNodeList 
)
static

Static conversion function.

Returns
The number value of the node list
static double XObject::number ( XPathExecutionContext executionContext,
const XalanNode theNode 
)
static

Static conversion function.

Returns
The number value of the node
virtual void XObject::ProcessXObjectTypeCallback ( XObjectTypeCallback theCallbackObject)
pure virtual

Process a callback request for preferred type information.

Parameters
theCallbackObjectobject to call back

Implemented in XResultTreeFrag, XNull, XUnknown, XStringBase, XNodeSetBase, XToken, XBoolean, and XNumberBase.

virtual void XObject::ProcessXObjectTypeCallback ( XObjectTypeCallback theCallbackObject) const
pure virtual

Process a callback request for preferred type information.

Parameters
theCallbackObjectobject to call back

Implemented in XResultTreeFrag, XNull, XUnknown, XStringBase, XNodeSetBase, XToken, XBoolean, and XNumberBase.

virtual void XObject::referenced ( )
protectedvirtual

Implements XalanReferenceCountedObject.

Reimplemented in XToken.

virtual const XalanDocumentFragment& XObject::rtree ( ) const
virtual

Cast result object to a result tree fragment.

Returns
result tree fragment

Reimplemented in XResultTreeFrag, XStringBase, and XNodeSetBase.

void XObject::setFactory ( XObjectFactory theFactory)
virtual const XalanDOMString& XObject::str ( ) const
virtual
virtual void XObject::str ( FormatterListener formatterListener,
MemberFunctionPtr  function 
) const
pure virtual

Send the string value to a FormatterListener instance.

Parameters
formatterListenerThe FormatterListener instance
functionA pointer to the member function of FormatterListener to call

Implemented in XResultTreeFrag, XNull, XUnknown, XStringBase, XToken, XNodeSetBase, XString, XTokenStringAdapter, XBoolean, XStringCached, XTokenNumberAdapter, XNumber, XNumberBase, XStringReference, and XStringAdapter.

virtual void XObject::str ( XalanDOMString theBuffer) const
virtual

Append the string value directly a string.

Parameters
theBufferThe buffer for the data

Reimplemented in XResultTreeFrag, XToken, XNodeSetBase, XTokenStringAdapter, XTokenNumberAdapter, and XNumber.

static const XalanDOMString& XObject::string ( bool  theBool)
static

Static conversion function.

Returns
The string value of the number
static void XObject::string ( bool  theBool,
FormatterListener formatterListener,
MemberFunctionPtr  function 
)
static
static void XObject::string ( double  theNumber,
XalanDOMString theString 
)
static

Static conversion function.

Returns
The string value of the number
static void XObject::string ( double  theNumber,
FormatterListener formatterListener,
MemberFunctionPtr  function 
)
static
static void XObject::string ( const XalanNode theNode,
XalanDOMString theString 
)
static

Static conversion function.

Returns
The string value of the node
static void XObject::string ( const XalanNode theNode,
FormatterListener formatterListener,
MemberFunctionPtr  function 
)
static
static void XObject::string ( const NodeRefListBase theNodeList,
XalanDOMString theString 
)
static

Static conversion function.

Returns
The string value of the node list
static void XObject::string ( const NodeRefListBase theNodeList,
FormatterListener formatterListener,
MemberFunctionPtr  function 
)
static
virtual double XObject::stringLength ( ) const
pure virtual

Get the length of the string value of the instance.

Returns
The length of the string value

Implemented in XResultTreeFrag, XNull, XUnknown, XStringBase, XToken, XString, XNodeSetBase, XTokenStringAdapter, XBoolean, XStringCached, XTokenNumberAdapter, XNumberBase, XStringReference, XNumber, and XStringAdapter.

static void XObject::terminate ( )
static

Perform static shut down.

See class XPathInit.

Friends And Related Function Documentation

friend class XObjectFactory
friend
friend class XObjectPtr
friend

Member Data Documentation

const XalanDOMString& XObject::s_booleanString
staticprotected
const XalanDOMString XObject::s_emptyString
staticprotected
const XalanDOMString& XObject::s_falseString
staticprotected
const XalanDOMString& XObject::s_nodesetString
staticprotected
const XalanDOMString& XObject::s_numberString
staticprotected
const XalanDOMString& XObject::s_resultTreeFragmentString
staticprotected
const XalanDOMString& XObject::s_stringString
staticprotected
const XalanDOMString& XObject::s_trueString
staticprotected

The documentation for this class was generated from the following file:

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

dot

Xalan-C++ XSLT Processor Version 1.10
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.

Apache Logo