zorba::SequenceType

#include <zorba/typeident.h>

Representation and factory for xquery sequence types. Class SequenceType represents xquery sequence types, as defined in http://www.w3.org/TR/xquery-30/#id-sequencetype-syntax. Instances of SequenceType may be returned by methods of Zorba's C++ API. The class also provides static methods to create instances of SequenceType, which can then be passed as arguments to other methods of Zorba's C++ API.

Public Types

Kind

Quantifier

Public Static Attributes

char const *const

kind_string_of[]

char const *const

quantifier_string_of[]

Friend Classes

friend class

Unmarshaller

Private Attributes

const XQType *

theType

Public Static Functions

SequenceType

createAnyNodeType(Quantifier q=QUANT_ONE)

Create an node() type with quantifier.

SequenceType

createAtomicOrUnionType(const StaticContext_t &sctx, const String &uri, const String &localName, Quantifier q=QUANT_ONE)

Create a generalized atomic type (see http://www.w3.org/TR/xquery-30/#dt-generalized-atomic-type ) with quantifier.

SequenceType

createAttributeType(const StaticContext_t &sctx, const String &nodeUri, const String &nodeLocalName, const String &contentTypeUri, const String &contentTypeLocalName, Quantifier quant=QUANT_ONE)

SequenceType

createCommentType(Quantifier q=QUANT_ONE)

SequenceType

createDocumentType(const SequenceType &contentType, Quantifier q=QUANT_ONE)

Create a document-node() type or subtype with quantifier.

SequenceType

createElementType(const StaticContext_t &sctx, const String &nodeUri, const String &nodeLocalName, const String &contentTypeUri, const String &contentTypeLocalName, bool nillable, Quantifier quant=QUANT_ONE)

Create an element() type or subtype with quantifier.

SequenceType

createEmptyType()

Create an empty-sequence() type.

SequenceType

createItemType(Quantifier q=QUANT_ONE)

Create an item() type with quantifier.

SequenceType

createJSONArrayType(Quantifier q=QUANT_ONE)

SequenceType

createJSONItemType(Quantifier q=QUANT_ONE)

SequenceType

createJSONObjectType(Quantifier q=QUANT_ONE)

SequenceType

createNamespaceType(Quantifier q=QUANT_ONE)

SequenceType

createPIType(Quantifier q=QUANT_ONE)

SequenceType

createSchemaAttributeType(const StaticContext_t &sctx, const String &uri, const String &localName, Quantifier quant=QUANT_ONE)

SequenceType

createSchemaElementType(const StaticContext_t &sctx, const String &uri, const String &localName, Quantifier quant=QUANT_ONE)

SequenceType

createStructuredItemType(Quantifier q=QUANT_ONE)

Create an structured-item() type with quantifier.

SequenceType

createTextType(Quantifier q=QUANT_ONE)

Public Functions

std::ostream &

emit(std::ostream &) const

SequenceType

getContentType() const

If this is an document-node() type that contains an embedded element() type, this method returns the embedded element() type.

String

getContentTypeLocalName() const

If this is an element() or attribute() type that contains a TypeName, this method returns the local name of that TypeName.

String

getContentTypeUri() const

If this is an element() or attribute() type that contains a TypeName, this method returns the URI of that TypeName.

Kind

getKind() const

String

getNodeLocalName() const

If this is an element() or attribute() type that contains a NodeName, this method returns the local part of that NodeName.

String

getNodeUri() const

If this is an element() or attribute() type that contains a NodeName, this method returns the URI of that NodeName.

Quantifier

getQuantifier() const

String

getTypeLocalName() const

If this is a generalized atomic type, this method returns the local part of the type name.

String

getTypeUri() const

If this is a generalized atomic type, this method returns the URI of the type name.

bool

isSchemaTest() const

Return true if this type is a schema-element() or schema-attribute() type, Otherwise return false.

bool

isValid() const

Returns true if this a valid (non-NULL) type; otherwise, returns false.

bool

isWildcard() const

If this is an element() or attribute() type that does not contain a NodeName, this method returns true.

SequenceType()

Constructor for an invalid (NULL) type.

SequenceType(const SequenceType &other)

Copy constructor.

~SequenceType()

Destructor.

Private Functions

SequenceType(const XQType *t)

Public Types

Kind

 Kind

Quantifier

 Quantifier

Public Static Attributes

kind_string_of

char const *const kind_string_of[]

quantifier_string_of

char const *const quantifier_string_of[]

Friend Classes

Unmarshaller

friend class Unmarshaller

Private Attributes

theType

const XQType * theType

Public Static Functions

createAnyNodeType

SequenceType createAnyNodeType(Quantifier q=QUANT_ONE)

Create an node() type with quantifier.

createAtomicOrUnionType

SequenceType createAtomicOrUnionType(const StaticContext_t &sctx, const String &uri, const String &localName, Quantifier q=QUANT_ONE)

Create a generalized atomic type (see http://www.w3.org/TR/xquery-30/#dt-generalized-atomic-type ) with quantifier.

A generalized atomic type is specified simply as a QName, which may identify an XMLSchema builtin atomic type or a user-defined atomic or pure union type. In the case of user-defined types, the QName must be among the in-scope type names of a given static context. Otherwise, for builtin types, the given sctx may be NULL.If the given QName (uri and local name pair) does not specify a generalized atomic type among the in-scope type names of a given static context, an invalid SequenceType is returned.

createAttributeType

SequenceType createAttributeType(const StaticContext_t &sctx, const String &nodeUri, const String &nodeLocalName, const String &contentTypeUri, const String &contentTypeLocalName, Quantifier quant=QUANT_ONE)

createCommentType

SequenceType createCommentType(Quantifier q=QUANT_ONE)

createDocumentType

SequenceType createDocumentType(const SequenceType &contentType, Quantifier q=QUANT_ONE)

Create a document-node() type or subtype with quantifier.

createElementType

SequenceType createElementType(const StaticContext_t &sctx, const String &nodeUri, const String &nodeLocalName, const String &contentTypeUri, const String &contentTypeLocalName, bool nillable, Quantifier quant=QUANT_ONE)

Create an element() type or subtype with quantifier.

createEmptyType

SequenceType createEmptyType()

Create an empty-sequence() type.

createItemType

SequenceType createItemType(Quantifier q=QUANT_ONE)

Create an item() type with quantifier.

createJSONArrayType

SequenceType createJSONArrayType(Quantifier q=QUANT_ONE)

createJSONItemType

SequenceType createJSONItemType(Quantifier q=QUANT_ONE)

createJSONObjectType

SequenceType createJSONObjectType(Quantifier q=QUANT_ONE)

createNamespaceType

SequenceType createNamespaceType(Quantifier q=QUANT_ONE)

createPIType

SequenceType createPIType(Quantifier q=QUANT_ONE)

createSchemaAttributeType

SequenceType createSchemaAttributeType(const StaticContext_t &sctx, const String &uri, const String &localName, Quantifier quant=QUANT_ONE)

createSchemaElementType

SequenceType createSchemaElementType(const StaticContext_t &sctx, const String &uri, const String &localName, Quantifier quant=QUANT_ONE)

createStructuredItemType

SequenceType createStructuredItemType(Quantifier q=QUANT_ONE)

Create an structured-item() type with quantifier.

createTextType

SequenceType createTextType(Quantifier q=QUANT_ONE)

Public Functions

emit

std::ostream & emit(std::ostream &) const

getContentType

SequenceType getContentType() const

If this is an document-node() type that contains an embedded element() type, this method returns the embedded element() type.

In all other cases, an invalid SequenceType is returned.

getContentTypeLocalName

String getContentTypeLocalName() const

If this is an element() or attribute() type that contains a TypeName, this method returns the local name of that TypeName.

If this is a schema-element(N) or schema-attribute(N) type, the method returns the local name of the XMLSchema type associated with the global element or attribute declaration N. In all other cases, it returns an empty string.

getContentTypeUri

String getContentTypeUri() const

If this is an element() or attribute() type that contains a TypeName, this method returns the URI of that TypeName.

If this is a schema-element(N) or schema-attribute(N) type, the method returns the URI of the XMLSchema type associated with the global element or attribute declaration N. In all other cases, it returns an empty string.

getKind

Kind getKind() const

getNodeLocalName

String getNodeLocalName() const

If this is an element() or attribute() type that contains a NodeName, this method returns the local part of that NodeName.

If this is a schema-element(N) or schema-attribute(N) type, the method returns the local part of N. If this is a processing-instruction() that contains a TargetName, that TargetName is returned. In all other cases, an empty string is returned.

getNodeUri

String getNodeUri() const

If this is an element() or attribute() type that contains a NodeName, this method returns the URI of that NodeName.

If this is a schema-element(N) or schema-attribute(N) type, the method returns the URI of N. In all other cases, an empty string is returned.

getQuantifier

Quantifier getQuantifier() const

getTypeLocalName

String getTypeLocalName() const

If this is a generalized atomic type, this method returns the local part of the type name.

For other kinds of types, an empty string is returned.

getTypeUri

String getTypeUri() const

If this is a generalized atomic type, this method returns the URI of the type name.

For other kinds of types, an empty string is returned.

isSchemaTest

bool isSchemaTest() const

Return true if this type is a schema-element() or schema-attribute() type, Otherwise return false.

isValid

bool isValid() const

Returns true if this a valid (non-NULL) type; otherwise, returns false.

isWildcard

bool isWildcard() const

If this is an element() or attribute() type that does not contain a NodeName, this method returns true.

In all other cases, false is returned.

SequenceType

 SequenceType()

Constructor for an invalid (NULL) type.

SequenceType

 SequenceType(const SequenceType &other)

Copy constructor.

~SequenceType

 ~SequenceType()

Destructor.

Private Functions

SequenceType

 SequenceType(const XQType *t)