zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #09636
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
Rodolfo Ochoa has proposed merging lp:~zorba-coders/zorba/xqjdoc into lp:zorba.
Requested reviews:
Cezar Andrei (cezar-andrei)
Matthias Brantner (matthias-brantner)
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/xqjdoc/+merge/105700
Complete XQJ Documentation
--
https://code.launchpad.net/~zorba-coders/zorba/xqjdoc/+merge/105700
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'doc/xqj/doxy.config.in'
--- doc/xqj/doxy.config.in 2012-04-03 21:33:33 +0000
+++ doc/xqj/doxy.config.in 2012-05-14 18:27:25 +0000
@@ -1,442 +1,623 @@
-# Doxyfile 1.4.5
+# Doxyfile 1.7.5
# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
+# doxygen (www.doxygen.org) for a project.
#
-# All text after a hash (#) is considered a comment and will be ignored
+# All text after a hash (#) is considered a comment and will be ignored.
# The format is:
# TAG = value [value, ...]
# For lists items can also be appended using:
# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
+# Values that contain spaces should be placed between quotes (" ").
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = "Zorba XQJ-API"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should
+# identify the project. Note that if you do not use Doxywizard you need
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME = "Zorba CXX-API"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
# if some version control system is used.
PROJECT_NUMBER = @ZORBA_MAJOR_NUMBER@.@ZORBA_MINOR_NUMBER@.@ZORBA_PATCH_NUMBER@
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is
+# included in the documentation. The maximum height of the logo should not
+# exceed 55 pixels and the maximum width should not exceed 200 pixels.
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
# otherwise cause performance problems for the file system.
CREATE_SUBDIRS = NO
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish,
-# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese,
-# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish,
-# Swedish, and Ukrainian.
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
OUTPUT_LANGUAGE = English
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
# Set to NO to disable this.
BRIEF_MEMBER_DESC = YES
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
# brief descriptions will be completely suppressed.
REPEAT_BRIEF = YES
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
# "represents" "a" "an" "the"
-ABBREVIATE_BRIEF =
+ABBREVIATE_BRIEF =
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
# description.
ALWAYS_DETAILED_SEC = NO
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
# operators of the base classes will not be shown.
INLINE_INHERITED_MEMB = YES
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = NO
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
# path to strip.
-STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/src @CMAKE_BINARY_DIR@/src
-
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
+STRIP_FROM_PATH = @CMAKE_SOURCE_DIR@/src \
+ @CMAKE_BINARY_DIR@/src
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
# are normally passed to the compiler using the -I flag.
-STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@/include @CMAKE_BINARY_DIR@/include
+STRIP_FROM_INC_PATH = @CMAKE_SOURCE_DIR@/include \
+ @CMAKE_BINARY_DIR@/include
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful if your file system
# doesn't support long names like on DOS, Mac, or CD-ROM.
SHORT_NAMES = NO
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like the Qt-style comments (thus requiring an
-# explicit @brief command for a brief description.
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
JAVADOC_AUTOBRIEF = YES
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member
-# documentation.
-
-DETAILS_AT_TOP = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
# re-implements.
INHERIT_DOCS = YES
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
# be part of the file/class/namespace that contains it.
SEPARATE_MEMBER_PAGES = NO
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
TAB_SIZE = 2
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
-ALIASES =
+ALIASES =
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
# of all members will be omitted, etc.
-OPTIMIZE_OUTPUT_FOR_C = YES
+OPTIMIZE_OUTPUT_FOR_C = NO
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for Java.
-# For instance, namespaces will be presented as packages, qualified scopes
-# will look different, etc.
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
OPTIMIZE_OUTPUT_JAVA = NO
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
-# include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this
+# tag. The format is ext=language, where ext is a file extension, and language
+# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
+# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
+# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
+# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also makes the inheritance and collaboration
# diagrams that involve STL classes more complete and accurate.
-# BUILTIN_STL_SUPPORT = NO
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
# all members of a group must be documented explicitly.
DISTRIBUTE_GROUP_DOC = NO
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
# the \nosubgrouping command.
SUBGROUPING = YES
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
+# unions are shown inside the group in which they are included (e.g. using
+# @ingroup) instead of on a separate page (for HTML and Man pages) or
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
+# unions with only public data fields will be shown inline in the documentation
+# of the scope in which they are defined (i.e. file, namespace, or group
+# documentation), provided this scope is documented. If set to NO (the default),
+# structs, classes, and unions are shown on a separate page (for HTML and Man
+# pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penalty.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will roughly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE = 0
+
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
EXTRACT_ALL = YES
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
# will be included in the documentation.
EXTRACT_PRIVATE = NO
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
# will be included in the documentation.
EXTRACT_STATIC = NO
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
# If set to NO only classes defined in header files are included.
EXTRACT_LOCAL_CLASSES = YES
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
# If set to NO (the default) only methods in the interface are included.
EXTRACT_LOCAL_METHODS = NO
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
# This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_MEMBERS = YES
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
# overviews. This option has no effect if EXTRACT_ALL is enabled.
HIDE_UNDOC_CLASSES = YES
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
# documentation.
HIDE_FRIEND_COMPOUNDS = NO
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
# function's detailed documentation block.
HIDE_IN_BODY_DOCS = NO
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
# Set it to YES to include the internal documentation.
INTERNAL_DOCS = NO
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
CASE_SENSE_NAMES = YES
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
# documentation. If set to YES the scope will be hidden.
HIDE_SCOPE_NAMES = NO
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = YES
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
# is inserted in the documentation for inline members.
INLINE_INFO = YES
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
# declaration order.
SORT_MEMBER_DOCS = YES
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
# declaration order.
SORT_BRIEF_DOCS = YES
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
+# will sort the (brief and detailed) documentation of class members so that
+# constructors and destructors are listed first. If set to NO (the default)
+# the constructors will appear in the respective orders defined by
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
+# Note: This option applies only to the class list, not to the
# alphabetical list.
SORT_BY_SCOPE_NAME = NO
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
+# do proper type resolution of all parameters of a function it will reject a
+# match between the prototype and the implementation of a member function even
+# if there is only one candidate or it is obvious which candidate to choose
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
# commands in the documentation.
GENERATE_TODOLIST = YES
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
# commands in the documentation.
GENERATE_TESTLIST = YES
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
# commands in the documentation.
GENERATE_BUGLIST = YES
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
# \deprecated commands in the documentation.
GENERATE_DEPRECATEDLIST= YES
-# The ENABLED_SECTIONS tag can be used to enable conditional
+# The ENABLED_SECTIONS tag can be used to enable conditional
# documentation sections, marked by \if sectionname ... \endif.
ENABLED_SECTIONS =
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or macro consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and macros in the
+# documentation can be controlled using \showinitializer or \hideinitializer
# command in the documentation regardless of this setting.
MAX_INITIALIZER_LINES = 30
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is YES.
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
SHOW_DIRECTORIES = YES
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from the
-# version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
# is used as the file version. See the manual for examples.
-FILE_VERSION_FILTER =
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. The create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option.
+# You can optionally specify a file name after the option, if omitted
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files
+# containing the references data. This must be a list of .bib files. The
+# .bib extension is automatically appended if omitted. Using this command
+# requires the bibtex tool to be installed. See also
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
+# of the bibliography can be controlled using LATEX_BIB_STYLE.
+
+CITE_BIB_FILES =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
-# The QUIET tag can be used to turn on/off the messages that are generated
+# The QUIET tag can be used to turn on/off the messages that are generated
# by doxygen. Possible values are YES and NO. If left blank NO is used.
QUIET = NO
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
# NO is used.
WARNINGS = YES
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
# automatically be disabled.
WARN_IF_UNDOCUMENTED = YES
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
# don't exist or using markup commands wrongly.
WARN_IF_DOC_ERROR = YES
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
# documentation.
WARN_NO_PARAMDOC = NO
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
# be obtained via FILE_VERSION_FILTER)
WARN_FORMAT = @DOXY_WARN_FORMAT@
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
# to stderr.
WARN_LOGFILE = Doc/doxy.log
@@ -445,145 +626,194 @@
# configuration options related to the input files
#---------------------------------------------------------------------------
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @CMAKE_CURRENT_SOURCE_DIR@/manual
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
-
-FILE_PATTERNS = *.java *.dox
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
+INPUT = @CMAKE_SOURCE_DIR@/swig/xqj \
+ @CMAKE_CURRENT_SOURCE_DIR@/manual
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS = *.java \
+ *.dox
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
# If left blank NO is used.
RECURSIVE = YES
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
+# Note that relative paths are relative to directory from which doxygen is run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
# from the input.
EXCLUDE_SYMLINKS = NO
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
EXCLUDE_PATTERNS = */.svn \
- */.svn/*
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
+ */.svn/* \
+ */zorba/zorbac.h
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
# the \include command).
-EXAMPLE_PATH = @CMAKE_CURRENT_BINARY_DIR@/examples
+EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/examples \
+ @CMAKE_SOURCE_DIR@/test/rbkt/Queries
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
# blank all files are included.
-EXAMPLE_PATTERNS = *.java
+EXAMPLE_PATTERNS = *.cpp \
+ *.cc \
+ *.h \
+ *.hh \
+ *.xq \
+ INSTALL \
+ DEPENDENCIES \
+ CHANGELOG \
+ LICENSE \
+ LGPL
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
# Possible values are YES and NO. If left blank NO is used.
EXAMPLE_RECURSIVE = YES
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
# the \image command).
IMAGE_PATH = @CMAKE_CURRENT_SOURCE_DIR@
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
# ignored.
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty or if
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
# files to browse (i.e. when SOURCE_BROWSER is set to YES).
FILTER_SOURCE_FILES = NO
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
+# and it is also possible to disable source filtering for a specific pattern
+# using *.ext= (so without naming a filter). This option only has effect when
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS =
+
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
# VERBATIM_HEADERS is set to NO.
SOURCE_BROWSER = YES
-# Setting the INLINE_SOURCES tag to YES will include the body
+# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
INLINE_SOURCES = NO
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
# fragments. Normal C and C++ comments will always remain visible.
STRIP_CODE_COMMENTS = NO
-# If the REFERENCED_BY_RELATION tag is set to YES (the default)
-# then for each documented function all documented
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
# functions referencing it will be listed.
REFERENCED_BY_RELATION = YES
-# If the REFERENCES_RELATION tag is set to YES (the default)
-# then for each documented function all documented entities
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
# called/used by that function will be listed.
REFERENCES_RELATION = YES
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
# will need version 4.8.6 or higher.
USE_HTAGS = NO
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
# which an include is specified. Set to NO to disable this.
VERBATIM_HEADERS = YES
@@ -592,281 +822,548 @@
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
# contains a lot of classes, structs, unions or interfaces.
ALPHABETICAL_INDEX = YES
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
# in which this list will be split (can be a number in the range [1..20])
COLS_IN_ALPHA_INDEX = 2
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
# should be ignored while generating the index headers.
-IGNORE_PREFIX =
+IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
# generate HTML output.
GENERATE_HTML = YES
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `html' will be used as the default path.
HTML_OUTPUT = html
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
# doxygen will generate files with .html extension.
HTML_FILE_EXTENSION = .html
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header. Note that when using a custom header you are responsible
+# for the proper inclusion of any scripts and style sheets that doxygen
+# needs, which is dependent on the configuration options used.
+# It is adviced to generate a default header using "doxygen -w html
+# header.html footer.html stylesheet.css YourConfigFile" and then modify
+# that header. Note that the header is subject to change so you typically
+# have to redo this when upgrading to a newer version of doxygen or when
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
HTML_HEADER = @CMAKE_CURRENT_SOURCE_DIR@/../style/header.html
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER = @CMAKE_CURRENT_SOURCE_DIR@/../style/footer.html
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
+# If the HTML_TIMESTAMP tag is set to YES then the generated HTML documentation will contain the timesstamp.
+
+HTML_TIMESTAMP = NO
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
# stylesheet in the HTML output directory as well, or it will be erased!
HTML_STYLESHEET = @CMAKE_CURRENT_SOURCE_DIR@/../style/stylesheet.css
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
+# Doxygen will adjust the colors in the stylesheet and background images
+# according to this color. Hue is specified as an angle on a colorwheel,
+# see http://en.wikipedia.org/wiki/Hue for more information.
+# For instance the value 0 represents red, 60 is yellow, 120 is green,
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
+# the colors in the HTML output. For a value of 0 the output will use
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
+# the luminance component of the colors in the HTML output. Values below
+# 100 gradually make the output lighter, whereas values above 100 make
+# the output darker. The value divided by 100 is the actual gamma applied,
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
# NO a bullet list will be used.
HTML_ALIGN_MEMBERS = YES
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+
+GENERATE_DOCSET = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
# of the generated HTML documentation.
GENERATE_HTMLHELP = YES
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
# written to the html output directory.
-CHM_FILE =
+CHM_FILE =
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
# the HTML help compiler on the generated index.hhp.
-HHC_LOCATION =
+HHC_LOCATION =
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
# it should be included in the master .chm file (NO).
GENERATE_CHI = NO
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
# normal table of contents (NO) in the .chm file.
BINARY_TOC = NO
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
# to the contents of the HTML help documentation and to the tree view.
TOC_EXPAND = NO
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
+# that can be used as input for Qt's qhelpgenerator to generate a
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
+# add. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+# will be generated, which together with the HTML files, form an Eclipse help
+# plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
+# the help appears.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
DISABLE_INDEX = NO
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML
+# documentation. Note that a value of 0 will completely suppress the enum
+# values from appearing in the overview section.
ENUM_VALUES_PER_LINE = 4
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
-# probably better off using the HTML help feature.
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
GENERATE_TREEVIEW = NO
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
# is shown.
TREEVIEW_WIDTH = 250
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are
+# not supported properly for IE 6.0, but are supported on all modern browsers.
+# Note that when changing this option you need to delete any form_*.png files
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
+# (see http://www.mathjax.org) which uses client side Javascript for the
+# rendering instead of using prerendered bitmaps. Use this if you do not
+# have LaTeX installed or if you want to formulas look prettier in the HTML
+# output. When enabled you also need to install MathJax separately and
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you need to specify the location relative to the
+# HTML output directory using the MATHJAX_RELPATH option. The destination
+# directory should contain the MathJax.js script. For instance, if the mathjax
+# directory is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the
+# mathjax.org site, so you can quickly see the result without installing
+# MathJax, but it is strongly recommended to install a local copy of MathJax
+# before deployment.
+
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box
+# for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
+# (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a PHP enabled web server instead of at the web client
+# using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server
+# based approach is that it scales better to large projects and allows
+# full text search. The disadvantages are that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH = NO
+
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
# generate Latex output.
GENERATE_LATEX = NO
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `latex' will be used as the default path.
LATEX_OUTPUT = latex
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked. If left blank `latex' will be used as the default command name.
-
-#LATEX_CMD_NAME = latex
-LATEX_CMD_NAME = @LATEX_COMPILER@
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME = @LATEX_COMPILER@
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
# default command name.
-#MAKEINDEX_CMD_NAME = makeindex
MAKEINDEX_CMD_NAME = @MAKEINDEX_COMPILER@
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_LATEX = NO
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, letter, legal and
# executive. If left blank a4wide will be used.
PAPER_TYPE = a4
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
# packages that should be included in the LaTeX output.
-EXTRA_PACKAGES =
+EXTRA_PACKAGES =
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
# standard header. Notice: only use this tag if you know what you are doing!
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
+# the generated latex document. The footer should contain everything after
+# the last chapter. If it is left blank doxygen will generate a
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
# This makes the output suitable for online browsing using a pdf viewer.
PDF_HYPERLINKS = YES
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
# higher quality PDF documentation.
USE_PDFLATEX = YES
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
# This option is also used when generating formulas in HTML.
LATEX_BATCHMODE = YES
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
# in the output.
LATEX_HIDE_INDICES = NO
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include
+# source code with syntax highlighting in the LaTeX output.
+# Note that which sources are shown also depends on other settings
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE = plain
+
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
# other RTF readers or editors.
GENERATE_RTF = NO
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `rtf' will be used as the default path.
RTF_OUTPUT = rtf
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
# save some trees in general.
COMPACT_RTF = NO
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
# Note: wordpad (write) and others do not support links.
RTF_HYPERLINKS = NO
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
-RTF_STYLESHEET_FILE =
+RTF_STYLESHEET_FILE =
-# Set optional variables used in the generation of an rtf document.
+# Set optional variables used in the generation of an rtf document.
# Syntax is similar to doxygen's config file.
-RTF_EXTENSIONS_FILE =
+RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
GENERATE_MAN = NO
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `man' will be used as the default path.
MAN_OUTPUT = man
-# The MAN_EXTENSION tag determines the extension that is added to
+# The MAN_EXTENSION tag determines the extension that is added to
# the generated man pages (default is the subroutine's section .3)
MAN_EXTENSION = .3
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
# would be unable to find the correct page. The default is NO.
MAN_LINKS = NO
@@ -875,33 +1372,33 @@
# configuration options related to the XML output
#---------------------------------------------------------------------------
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
# the code including all documentation.
GENERATE_XML = NO
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
# put in front of it. If left blank `xml' will be used as the default path.
XML_OUTPUT = xml
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
# enabling this will significantly increase the size of the XML output.
XML_PROGRAMLISTING = YES
@@ -910,10 +1407,10 @@
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
# and incomplete at the moment.
GENERATE_AUTOGEN_DEF = NO
@@ -922,286 +1419,359 @@
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
# moment.
GENERATE_PERLMOD = NO
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
# to generate PDF and DVI output from the Perl module output.
PERLMOD_LATEX = NO
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader. This is useful
-# if you want to understand what is going on. On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
# and Perl will parse it just the same.
PERLMOD_PRETTY = YES
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
# Makefile don't overwrite each other's variables.
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
# files.
ENABLE_PREPROCESSING = YES
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
# way by setting EXPAND_ONLY_PREDEF to YES.
MACRO_EXPANSION = YES
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
# PREDEFINED and EXPAND_AS_DEFINED tags.
EXPAND_ONLY_PREDEF = YES
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
SEARCH_INCLUDES = YES
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
# the preprocessor.
-INCLUDE_PATH =
+INCLUDE_PATH =
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
# be used.
-INCLUDE_FILE_PATTERNS =
+INCLUDE_FILE_PATTERNS =
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
# instead of the = operator.
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition that
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all references to function-like macros
+# that are alone on a line, have an all uppercase name, and do not end with a
+# semicolon, because these will confuse the parser if not removed.
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
-# Configuration::additions related to external references
+# Configuration::additions related to external references
#---------------------------------------------------------------------------
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
# does not have to be run to correct the links.
# Note that each tag file must have a unique name
# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
+# If a tag file is not located in the directory in which doxygen
# is run, you must also specify the path to the tagfile here.
-TAGFILES =
+TAGFILES =
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
# a tag file that is based on the input files it reads.
GENERATE_TAGFILE = html/@PROJECT_NAME@.TAGFILE
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
# will be listed.
ALLEXTERNALS = YES
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
# be listed.
EXTERNAL_GROUPS = YES
-# The PERL_PATH should be the absolute path and name of the perl script
+# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of `which perl').
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
+# Configuration options related to the dot tool
#---------------------------------------------------------------------------
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option also works with HAVE_DOT disabled, but it is recommended to
+# install and use dot, since it yields more powerful graphs.
CLASS_DIAGRAMS = YES
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
# or is not a class.
HIDE_UNDOC_RELATIONS = YES
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
# have no effect if this option is set to NO (the default)
HAVE_DOT = @DOXYGEN_DOT_FOUND@
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
+# allowed to run in parallel. When set to 0 (the default) doxygen will
+# base this on the number of processors available in the system. You can set it
+# explicitly to a value larger than 0 to get control over the balance
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS = 0
+
+# By default doxygen will use the Helvetica font for all dot files that
+# doxygen generates. When you want a differently looking font you can specify
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find
+# the font, which can be done by putting it in a standard location or by setting
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
+# directory containing the font.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the Helvetica font.
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
+# set the path where dot can find it.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
# the CLASS_DIAGRAMS tag to NO.
CLASS_GRAPH = YES
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
# class references variables) of the class with other documented classes.
COLLABORATION_GRAPH = YES
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
# will generate a graph for groups, showing the direct groups dependencies
GROUP_GRAPHS = YES
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
# Language.
UML_LOOK = NO
-# UML_LOOK = YES
-# If set to YES, the inheritance and collaboration graphs will show the
+# If set to YES, the inheritance and collaboration graphs will show the
# relations between templates and their instances.
TEMPLATE_RELATIONS = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
# other documented files.
INCLUDE_GRAPH = YES
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
# indirectly include this file.
INCLUDED_BY_GRAPH = YES
-# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
-# generate a call dependency graph for every global function or class method.
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
CALL_GRAPH = NO
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will generate a graphical hierarchy of all classes instead of a textual one.
GRAPHICAL_HIERARCHY = YES
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
# in a graphical way. The dependency relations are determined by the #include
# relations between the files in the directories.
DIRECTORY_GRAPH = YES
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are svg, png, jpg, or gif.
+# If left blank png will be used. If you choose svg you need to set
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible in IE 9+ (other browsers do not have this requirement).
DOT_IMAGE_FORMAT = png
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+# Note that this requires a modern browser other than Internet Explorer.
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
# found. If left blank, it is assumed the dot tool can be found in the path.
DOT_PATH = @DOXYGEN_DOT_EXECUTABLE_PATH@
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
# \dotfile command).
-DOTFILE_DIRS =
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, which results in a white background.
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the
+# \mscfile command).
+
+MSCFILE_DIRS =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
DOT_TRANSPARENT = NO
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
# support this, this feature is disabled by default.
-# JW
-# DOT_MULTI_TARGETS = NO
+
DOT_MULTI_TARGETS = YES
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
# arrows in the dot generated graphs.
GENERATE_LEGEND = YES
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
# the various graphs.
DOT_CLEANUP = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be
-# used. If set to NO the values of all tags below this one will be ignored.
-
-# JW SEARCHENGINE = NO
-SEARCHENGINE = YES
=== modified file 'src/functions/func_ft_module_impl.cpp'
--- src/functions/func_ft_module_impl.cpp 2012-05-09 20:40:03 +0000
+++ src/functions/func_ft_module_impl.cpp 2012-05-14 18:27:25 +0000
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include "stdafx.h"
#include "functions/func_ft_module_impl.h"
#include "runtime/full_text/ft_module.h"
=== modified file 'src/runtime/full_text/ft_module_impl.cpp'
--- src/runtime/full_text/ft_module_impl.cpp 2012-05-09 16:35:09 +0000
+++ src/runtime/full_text/ft_module_impl.cpp 2012-05-14 18:27:25 +0000
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include "stdafx.h"
#include <zorba/config.h>
//
=== modified file 'swig/xqj/XQCollection.java'
--- swig/xqj/XQCollection.java 2012-04-28 05:52:32 +0000
+++ swig/xqj/XQCollection.java 2012-05-14 18:27:25 +0000
@@ -22,6 +22,12 @@
import javax.xml.xquery.XQSequence;
import org.zorbaxquery.api.ItemSequence;
+/** \brief A Collection is a persistent sequence of node items.
+ *
+ * Instances of this class can be used to modify or retrieve the contents
+ * of a collection.
+ *
+ */
public class XQCollection {
private boolean closed = false;
@@ -31,7 +37,13 @@
protected XQCollection(Collection col) {
collection = col;
}
-
+
+ /** \brief Closes the collection.
+ *
+ * Once the collection is closed, no method other than close or the isClosed method may be called on the collection object. Calling close on an XQCollection object that is already closed has no effect.
+ *
+ * @throw XQException - if there is an error during closing the collection.
+ */
public void close() throws XQException {
for (XQSequence exp : sequences ){
exp.close(); // Notify the dependents objects to close
@@ -42,10 +54,20 @@
closed = true;
}
+ /** \brief Checks if the collection is closed.
+ *
+ * @return true if the collection is in a closed state, false otherwise
+ */
public boolean isClosed() {
return closed;
}
+ /**
+ * \brief This function returns the sequence of nodes of the collection.
+ *
+ * @return The sequence contained in the given collection.
+ *
+ */
public XQSequence contents() throws XQException {
isClosedXQException();
XQSequence result = new org.zorbaxquery.api.xqj.XQSequence(collection.contents().getIterator());
@@ -53,16 +75,37 @@
return result;
}
+ /**
+ * \brief This function deletes the first node from a collection.
+ *
+ * @throw XQException if the collection doesn't contain any node.
+ *
+ */
public void deleteNodeFirst() throws XQException {
isClosedXQException();
collection.deleteNodeFirst();
}
+ /**
+ * \brief This function deletes the last node from a collection.
+ *
+ * @throw XQException if the collection doesn't contain any node.
+ *
+ */
public void deleteNodeLast() throws XQException {
isClosedXQException();
collection.deleteNodeLast();
}
+ /**
+ * \brief This function deletes zero of more nodes from a collection.
+ *
+ * @param aNodes the nodes in the collection that should be deleted.
+ *
+ * @throw XQException if any nodes in the given sequence is not a member of a collection
+ * or not all nodes of the sequence belong to the same collection.
+ *
+ */
public void deleteNodes(XQSequence aNodes ) throws XQException {
isClosedXQException();
try {
@@ -73,31 +116,80 @@
}
}
+ /**
+ * \brief This function deletes the n first nodes from a collection.
+ *
+ * @throw XQException if the collection doesn't contain any node.
+ *
+ */
public void deleteNodesFirst(long aNumNodes ) throws XQException {
isClosedXQException();
collection.deleteNodesFirst(aNumNodes);
}
+ /**
+ * \briefThis function deletes the n last nodes from a collection.
+ *
+ * @throw XQException if the collection doesn't contain any node.
+ *
+ */
public void deleteNodesLast(long aNumNodes ) throws XQException {
isClosedXQException();
collection.deleteNodesLast(aNumNodes);
}
+ /**
+ * \brief Get the name of the collection.
+ *
+ * @return The name of the collection.
+ */
public String getName() throws XQException {
isClosedXQException();
return collection.getName().getStringValue();
}
+ /**
+ * \brief Retrieves the sequence type for this (static declared) collection.
+ *
+ * @return the sequence type for the said collection, or 0
+ * if this collection is not statically declared.
+ *
+ * @see isStatic()
+ */
public XQItemType getType() throws XQException {
isClosedXQException();
return new XQItemType(collection.getType());
}
+ /**
+ * \brief This function returns the index of the given node in the collection.
+ *
+ * @param aNode The node to retrieve the index from.
+ *
+ * @return Returns the position of the given node in the collection.
+ *
+ * @throw XQException if node is not contained in any collection.
+ *
+ */
public long indexOf(XQItem aNode ) throws XQException {
isClosedXQException();
return collection.indexOf(((org.zorbaxquery.api.xqj.XQItem)aNode).getZorbaItem());
}
+ /**
+ * This function inserts copies of the given
+ * nodes into a collection at the position directly following the
+ * given target node.
+ *
+ * @param aTarget the node in the collection after which the
+ * sequence should be inserted.
+ * @param aNodes The sequences of nodes whose copies should
+ * be added to the collection.
+ *
+ * @throw XQException if any nodes in the sequence is not a member of a collection
+ * or not all nodes of the sequence belong to the same collection.
+ *
+ */
public void insertNodesAfter(XQItem aTarget, XQSequence aNodes ) throws XQException {
isClosedXQException();
try {
@@ -108,6 +200,20 @@
}
}
+ /**
+ * This function inserts copies of the given
+ * nodes into a collection at the position directly preceding the
+ * given target node.
+ *
+ * @param aTarget the node in the collection before which the
+ * sequence should be inserted.
+ * @param aNodes The sequences of nodes whose copies should
+ * be added to the collection.
+ *
+ * @throw XQException if any nodes in the sequence is not a member of a collection
+ * or not all nodes of the sequence belong to the same collection.
+ *
+ */
public void insertNodesBefore(XQItem aTarget, XQSequence aNodes ) throws XQException {
isClosedXQException();
try {
@@ -118,6 +224,14 @@
}
}
+ /**
+ * This function inserts copies of the
+ * given nodes at the beginning of the collection.
+ *
+ * @param aNodes The sequences of nodes whose copies
+ * should be added to the collection.
+ *
+ */
public void insertNodesFirst(XQSequence aNodes ) throws XQException {
isClosedXQException();
try {
@@ -128,6 +242,14 @@
}
}
+ /**
+ * This function inserts copies of the
+ * given nodes at the end of the collection.
+ *
+ * @param aNodes The sequences of nodes whose copies
+ * should be added to the collection.
+ *
+ */
public void insertNodesLast(XQSequence aNodes ) throws XQException {
isClosedXQException();
try {
@@ -138,6 +260,11 @@
}
}
+ /**
+ * The function checks if this collection has been statically declared.
+ *
+ * @return true if the collection is a static collection, false otherwise.
+ */
public boolean isStatic() throws XQException {
isClosedXQException();
return collection.isStatic();
=== modified file 'swig/xqj/XQCollectionManager.java'
--- swig/xqj/XQCollectionManager.java 2012-04-28 05:52:32 +0000
+++ swig/xqj/XQCollectionManager.java 2012-05-14 18:27:25 +0000
@@ -23,6 +23,10 @@
import javax.xml.xquery.XQItem;
+ /** \brief This class defines a set of functions for managing persistent
+ * collections.
+ *
+ */
public class XQCollectionManager {
private boolean closed = false;
@@ -34,6 +38,12 @@
collectionManager = cm;
}
+ /** \brief Closes the collection manager.
+ *
+ * Once the collection manager is closed, no method other than close or the isClosed method may be called on the collection manager object. Calling close on an XQCollectionManager object that is already closed has no effect.
+ *
+ * @throw XQException - if there is an error during closing the collection.
+ */
public void close() throws XQException {
for (XQSequence exp : sequences ){
exp.close(); // Notify the dependents objects to close
@@ -47,10 +57,25 @@
closed = true;
}
+ /** \brief Checks if the collection manager is closed.
+ *
+ * @return true if the collection manager is in a closed state, false otherwise
+ */
public boolean isClosed() {
return closed;
}
+ /**
+ * This function returns a sequence of names of the collections
+ * that are available. If this is an instance of the StaticCollectionManager
+ * class (i.e. returned by any of the getStaticCollectionManager methods),
+ * the collections returned by this function are also
+ * statically declared.
+ *
+ * @return The list of names of the available collections.
+ * @throw XQException if any error occurs retreiving the collections
+ *
+ */
public XQSequence availableCollections() throws XQException {
isClosedXQException();
XQSequence result = new org.zorbaxquery.api.xqj.XQSequence(collectionManager.availableCollections());
@@ -58,16 +83,40 @@
return result;
}
+ /**
+ * This function creates the collection with the given name.
+ *
+ * @param aName The name of the collection to create.
+ *
+ * @throw XQException if a collection with the given name already exists.
+ *
+ */
public void createCollection(XQItem aName ) throws XQException {
isClosedXQException();
collectionManager.createCollection(((org.zorbaxquery.api.xqj.XQItem)aName).getZorbaItem());
}
+ /**
+ * This function removes the collection with the given name.
+ *
+ * @param aName The name of the collection to delete.
+ *
+ * @throw XQException if the collection does not exist.
+ */
public void deleteCollection(XQItem aName ) throws XQException {
isClosedXQException();
collectionManager.deleteCollection(((org.zorbaxquery.api.xqj.XQItem)aName).getZorbaItem());
}
+ /**
+ * Returns a instance of the Collection class which can
+ * be used to modify and retrieve the contents of the collection
+ * identified by the given name.
+ *
+ * @param aName The name of the collection to retrieve.
+ *
+ * @throw XQException if the collection does not exist.
+ */
public XQCollection getCollection(XQItem aName ) throws XQException {
isClosedXQException();
XQCollection result = new XQCollection ( collectionManager.getCollection(((org.zorbaxquery.api.xqj.XQItem)aName).getZorbaItem()) );
@@ -75,6 +124,18 @@
return result;
}
+ /**
+ * This function returns true if a collection with the given name is available.
+ * If this is an instance of the StaticCollectionManager class (i.e.
+ * returned by any of the getStaticCollectionManager() methods),
+ * the collection also needs to be statically declared.
+ *
+ * @param aName The name of the collection that is being checked.
+ *
+ * @return true if the collection is available and false otherwise.
+ * @throw XQException if any error occurs verifying the collection
+ *
+ */
public boolean isAvailableCollection(XQItem aName ) throws XQException {
isClosedXQException();
return collectionManager.isAvailableCollection( ((org.zorbaxquery.api.xqj.XQItem)aName).getZorbaItem() );
=== modified file 'swig/xqj/XQConnection.java'
--- swig/xqj/XQConnection.java 2012-05-03 12:31:51 +0000
+++ swig/xqj/XQConnection.java 2012-05-14 18:27:25 +0000
@@ -70,6 +70,36 @@
import org.zorbaxquery.api.XmlDataManager;
import org.zorbaxquery.api.Zorba;
+ /**
+ *
+ * A connection (session) with a specific XQuery engine. Connections are obtained through an XQDataSource object.
+ *
+ * XQuery expressions are executed and results are returned within the context of a connection. They are either executed through XQExpression or XQPreparedExpression objects.
+ *
+ * XQDataSource ds;// obtain the XQuery datasource
+ * ...
+ * XQConnection conn = ds.getConnection();
+ *
+ * XQPreparedExpression expr = conn.prepareExpression("for $i in ...");
+ * XQResultSequence result = expr.executeQuery();
+ * // - or -
+ * XQExpression expr = conn.createExpression();
+ * XQSequence result = expr.executeQuery("for $i in..");
+ *
+ * // The sequence can now be iterated
+ * while (result.next())
+ * {
+ * String str = result.getItemAsString();
+ * System.out.println(" output "+ str);
+ * }
+ * result.close();
+ * expr.close();
+ * conn.close(); // close the connection and free all resources..
+ *
+ *
+ * A connection holds also default values for XQExpression and XQPreparedExpression properties. An application can override these defaults by passing an XQStaticContext object to the setStaticContext() method.
+ *
+ */
public class XQConnection implements javax.xml.xquery.XQConnection {
private InMemoryStore store;
private Zorba zorba;
@@ -144,7 +174,12 @@
}
-
+ /** \brief Closes the connection.
+ *
+ * Closes the connection. This also closes any XQExpression and XQPreparedExpression obtained from this connection. Once the connection is closed, no method other than close or the isClosed method may be called on the connection object. Calling close on an XQConnection object that is already closed has no effect. Note that an XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call this method explicitly to free any resources. It is also recommended that they do so under a final block to ensure that the object is closed even when there are exceptions.
+ *
+ * @throw XQException - if there is an error during closing the connection.
+ */
@Override
public void close() throws XQException {
if (closed) return; // already closed
@@ -183,18 +218,36 @@
autocommit = bln;
}
+ /** \brief Gets the auto-commit attribute of this connection
+ *
+ * @return the auto-commit attribute of this connection. true if the connection operates in auto-commit mode; otherwise false
+ * @throw XQException - if the connection is in a closed state
+ */
@Override
public boolean getAutoCommit() throws XQException {
isClosedXQException();
return autocommit;
}
+ /** \brief Makes all changes made in the current transaction permanent and releases any locks held by the datasource.
+ *
+ * This method should be used only when auto-commit mode is disabled. Any XQResultSequence, or XQResultItem may be implicitly closed upon commit, if the holdability property of the sequence is set to XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.
+ *
+ * @throw XQException - if the connection is in a closed state or this connection is operating in auto-commit mode
+ */
@Override
public void commit() throws XQException {
isClosedXQException();
throw new UnsupportedOperationException("Zorba does not support transactions... yet...");
}
+ /** \brief Creates a new XQExpression object that can be used to perform execute immediate operations with XQuery expressions.
+ *
+ * The properties of the connection's default XQStaticContext are copied to the returned XQExpression.
+ *
+ * @return XQExpression that can be used to execute multiple expressions
+ * @throw XQException - if the connection is in a closed state
+ */
@Override
public XQExpression createExpression() throws XQException {
isClosedXQException();
@@ -208,6 +261,14 @@
return expression;
}
+ /** \brief Creates a new XQExpression object that can be used to perform execute immediate operations with XQuery expressions.
+ *
+ * The properties of the specified XQStaticContext values are copied to the returned XQExpression.
+ *
+ * @param value - XQStaticContext containing values of expression properties
+ * @return XQExpression that can be used to execute multiple expressions
+ * @throw XQException - if (1) the connection is in a closed state, or (2) the specified argument is null
+ */
@Override
public XQExpression createExpression(XQStaticContext value) throws XQException {
isClosedXQException();
@@ -217,17 +278,34 @@
return expression;
}
+ /** \brief Gets the metadata for this connection.
+ *
+ * @return XQMetadata representing the metadata of this connection
+ * @throw XQException - if the connection is in a closed state
+ */
@Override
public XQMetaData getMetaData() throws XQException {
isClosedXQException();
return new org.zorbaxquery.api.xqj.XQMetaData(this);
}
+ /** \brief Checks if the connection is closed.
+ *
+ * @return true if the connection is in a closed state, false otherwise
+ */
@Override
public boolean isClosed() {
return closed;
}
+ /** \brief Prepares an expression for execution.
+ *
+ * The properties of the connection's default XQStaticContext are copied to the returned XQPreparedExpression.
+ *
+ * @param value - the XQuery expression as a String. Cannot be null
+ * @return the prepared XQuery expression
+ * @throw XQException - if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null
+ */
@Override
public XQPreparedExpression prepareExpression(String value) throws XQException {
isClosedXQException();
@@ -246,6 +324,15 @@
return expression;
}
+ /** \brief Prepares an expression for execution.
+ *
+ * The properties of the connection's default XQStaticContext are copied to the returned XQPreparedExpression.
+ *
+ * @param string - the XQuery expression as a String. Cannot be null
+ * @param xqsc - XQStaticContext containing values of expression properties.
+ * @return the prepared XQuery expression
+ * @throw XQException - if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null
+ */
@Override
public XQPreparedExpression prepareExpression(String string, XQStaticContext xqsc) throws XQException {
isClosedXQException();
@@ -261,6 +348,14 @@
return expression;
}
+ /** \brief Prepares an expression for execution.
+ *
+ * The properties of the connection's default XQStaticContext are copied to the returned XQPreparedExpression.
+ *
+ * @param reader - the XQuery expression as a Reader. Cannot be null
+ * @return the prepared XQuery expression
+ * @throw XQException - if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null
+ */
@Override
public XQPreparedExpression prepareExpression(Reader reader) throws XQException {
isClosedXQException();
@@ -291,6 +386,15 @@
return expression;
}
+ /** \brief Prepares an expression for execution.
+ *
+ * The properties of the connection's default XQStaticContext are copied to the returned XQPreparedExpression.
+ *
+ * @param reader - the XQuery expression as a Reader. Cannot be null
+ * @param xqsc - XQStaticContext containing values of expression properties
+ * @return the prepared XQuery expression
+ * @throw XQException - if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null
+ */
@Override
public XQPreparedExpression prepareExpression(Reader reader, XQStaticContext xqsc) throws XQException {
isClosedXQException();
@@ -316,6 +420,14 @@
return expression;
}
+ /** \brief Prepares an expression for execution.
+ *
+ * The properties of the connection's default XQStaticContext are copied to the returned XQPreparedExpression.
+ *
+ * @param in - the XQuery expression as an InputStream. Cannot be null
+ * @return the prepared XQuery expression
+ * @throw XQException - if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null
+ */
@Override
public XQPreparedExpression prepareExpression(InputStream in) throws XQException {
isClosedXQException();
@@ -345,6 +457,15 @@
return expression;
}
+ /** \brief Prepares an expression for execution.
+ *
+ * The properties of the connection's default XQStaticContext are copied to the returned XQPreparedExpression.
+ *
+ * @param in - the XQuery expression as an InputStream. Cannot be null
+ * @param xqsc - XQStaticContext containing values of expression properties
+ * @return the prepared XQuery expression
+ * @throw XQException - if (1) the connection is in a closed state, (2) there are errors preparing the expression, or (3) the xquery parameter is null
+ */
@Override
public XQPreparedExpression prepareExpression(InputStream in, XQStaticContext xqsc) throws XQException {
isClosedXQException();
@@ -370,11 +491,24 @@
return expression;
}
+ /** \brief Undoes all changes made in the current transaction and releases any locks held by the datasource.
+ *
+ * This method should be used only when auto-commit mode is disabled.
+ *
+ * @throw XQException - if the connection is in a closed state or this connection is operating in auto-commit mode
+ */
@Override
public void rollback() throws XQException {
throw new UnsupportedOperationException("Zorba does not support transactions... yet...");
}
+ /** \brief Gets an XQStaticContext representing the default values for all expression properties.
+ *
+ * In order to modify the defaults, it is not sufficient to modify the values in the returned XQStaticContext object; in addition setStaticContext should be called to make those new values effective.
+ *
+ * @return XQStaticContext representing the default values for all expression properties
+ * @throw XQException - if the connection is in a closed state
+ */
@Override
public XQStaticContext getStaticContext() throws XQException {
isClosedXQException();
@@ -391,6 +525,13 @@
return lStaticContext;
}
+ /** \brief Sets the default values for all expression properties.
+ *
+ * The implementation will read out all expression properties from the specified XQStaticContext and update its private copy.
+ *
+ * @param xqsc - XQStaticContext containing values of expression properties
+ * @throw XQException - if the connection is in a closed state
+ */
@Override
public void setStaticContext(XQStaticContext xqsc) throws XQException {
isClosedXQException();
@@ -401,6 +542,15 @@
lStaticContext = xqsc;
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the casting from xs:string rules outlined in 17.1.1 Casting from xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators. If the cast fails an XQException is thrown.
+ *
+ * @param value - the lexical string value of the type
+ * @param type - the item type
+ * @return XQItem representing the resulting item
+ * @throw XQException - if (1) any of the arguments are null, (2) given type is not an atomic type, (3) the conversion of the value to an XDM instance failed, or (4) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromAtomicValue(String value, XQItemType type) throws XQException {
isClosedXQException();
@@ -418,6 +568,16 @@
return item;
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type, which must represent an xs:string or a type derived by restriction from xs:string. If the specified type is null, it defaults to xs:string.
+ * Subsequently the value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, an XQException will be thrown.
+ *
+ * @param value - the value to be converted, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type, xs:string, is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromString(String value, XQItemType type) throws XQException {
isClosedXQException();
@@ -562,6 +722,20 @@
return item;
}
+ /** \brief Creates an item from the given value.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @return XQItem representing the resulting item
+ * @throw XQException - if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromDocument(String value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -592,6 +766,20 @@
return item;
}
+ /** \brief Creates an item from the given value.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @return XQItem representing the resulting item
+ * @throw XQException - if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromDocument(Reader value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -616,6 +804,20 @@
return item;
}
+ /** \brief Creates an item from the given value.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @return XQItem representing the resulting item
+ * @throw XQException - if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromDocument(InputStream value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -634,6 +836,19 @@
return item;
}
+ /** \brief Creates an item from the given value.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param value - the value to be converted, cannot be null
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @return XQItem representing the resulting item
+ * @throw XQException - if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromDocument(XMLStreamReader value, XQItemType type) throws XQException {
isClosedXQException();
@@ -669,6 +884,24 @@
return sw.toString();
}
+ /** \brief Creates an item from the given value.
+ *
+ * An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMSource
+ * - javax.xml.transform.sax.SAXSource
+ * - javax.xml.transform.stream.StreamSource
+ *
+ * If the value represents a well-formed XML document, it will result in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param value - the value to be converted, cannot be null
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @return XQItem representing the resulting item
+ * @throw XQException - if (1) the value argument is null, (2) the conversion of the value to an XDM instance failed, or (3) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromDocument(Source value, XQItemType type) throws XQException {
isClosedXQException();
@@ -687,6 +920,15 @@
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.
+ *
+ * @param value - the value to be converted
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromObject(Object value, XQItemType type) throws XQException {
isClosedXQException();
@@ -1069,8 +1311,6 @@
return item;
}
- // This method works for Decimal and all subtypes,
- // verifies that the type is correct and create the Item
private XQItem createDecimal(BigDecimal value, XQItemType type) throws XQException {
XQItem item = null;
try {
@@ -1126,7 +1366,16 @@
}
return item;
}
-
+
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.
+ *
+ * @param b - the value to be converted
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromByte(byte b, XQItemType type) throws XQException {
isClosedXQException();
@@ -1136,6 +1385,15 @@
return createDecimal(new BigDecimal(b), type);
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.
+ *
+ * @param value - the value to be converted
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromDouble(double value, XQItemType type) throws XQException {
isClosedXQException();
@@ -1155,6 +1413,15 @@
return item;
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.
+ *
+ * @param value - the value to be converted
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromFloat(float value, XQItemType type) throws XQException {
isClosedXQException();
@@ -1174,6 +1441,15 @@
return item;
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.
+ *
+ * @param value - the value to be converted
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromInt(int value, XQItemType type) throws XQException {
isClosedXQException();
@@ -1190,6 +1466,15 @@
return createDecimal(new BigDecimal(value), type);
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.
+ *
+ * @param value - the value to be converted
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromLong(long value, XQItemType type) throws XQException {
isClosedXQException();
@@ -1207,6 +1492,15 @@
return createDecimal(new BigDecimal(value), type);
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.
+ *
+ * @param value - the value to be converted
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromNode(Node value, XQItemType type) throws XQException {
isClosedXQException();
@@ -1221,6 +1515,15 @@
return result;
}
+ /** \brief Creates an item from a given value.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the converstion fails, an XQException will be thrown.
+ *
+ * @param value - the value to be converted
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @return XQItem representing the resulting item
+ * @throw XQException - (1) the conversion of the value to an XDM instance failed, or (2) the underlying object implementing the interface is closed
+ */
@Override
public XQItem createItemFromShort(short value, XQItemType type) throws XQException {
isClosedXQException();
@@ -1233,6 +1536,14 @@
return createDecimal(new BigDecimal(value), type);
}
+ /** \brief Creates a copy of the specified XQItem.
+ *
+ * This method can be used, for example, to copy an XQResultItem object so that the new item is not dependant on the connection.
+ *
+ * @param value - the XQItem to copy
+ * @return XQItem independent of any underlying XQConnection is created
+ * @throw XQException - if (1) the specified item is null, (2) the underlying object implementing the interface is closed, (3) the specified item is closed
+ */
@Override
public XQItem createItem(XQItem value) throws XQException {
isClosedXQException();
@@ -1244,6 +1555,14 @@
return result;
}
+ /** \brief Creates a copy of the specified XQSequence.
+ *
+ * Creates a copy of the specified XQSequence. The newly created XQSequence is scrollable and independent of any underlying XQConnection. The new XQSequence will contain all items from the specified XQSequence starting from its current position. The copy process will implicitly perform next operations on the specified sequence to read the items. All items are consumed, the current position of the cursor is set to point after the last item.
+ *
+ * @param value - input sequence
+ * @return XQSequence representing a copy of the input sequence
+ * @throw XQException - if (1) there are errors accessing the items in the specified sequence, (2) the specified sequence is closed, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) the s parameter is null, or (5) the underlying object implementing the interface is closed
+ */
@Override
public XQSequence createSequence(XQSequence value) throws XQException {
isClosedXQException();
@@ -1260,6 +1579,14 @@
return result;
}
+ /** \brief Creates an XQSequence, containing all the items from the iterator.
+ *
+ * The newly created XQSequence is scrollable and independent of any underlying XQConnection. If the iterator returns an XQItem, it is added to the sequence. If the iterator returns any other object, an item is added to the sequence following the rules from 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the iterator does not return any items, then an empty sequence is created.
+ *
+ * @param value - input sequence
+ * @return XQSequence representing a copy of the input sequence
+ * @throw XQException - if (1) there are errors accessing the items in the specified sequence, (2) the specified sequence is closed, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) the s parameter is null, or (5) the underlying object implementing the interface is closed
+ */
@Override
public XQSequence createSequence(Iterator value) throws XQException {
isClosedXQException();
@@ -1273,6 +1600,20 @@
return result;
}
+ /** \brief Creates a new XQItemType object representing an XQuery atomic type.
+ *
+ * The item kind of the item type will be XQItemType.XQITEMKIND_ATOMIC.
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ...;
+ *
+ * // to create xs:integer item type
+ * conn.createAtomicType(XQItemType.XQBASETYPE_INTEGER);
+ * \endcode
+ * @param basetype - one of the XQItemType.XQBASETYPE_* constants. All basetype constants except the following are valid:<br />XQItemType.XQBASETYPE_UNTYPED<br />XQItemType.XQBASETYPE_ANYTYPE<br />XQItemType.XQBASETYPE_IDREFS<br />XQItemType.XQBASETYPE_NMTOKENS<br />XQItemType.XQBASETYPE_ENTITIES<br />XQItemType.XQBASETYPE_ANYSIMPLETYPE<br />
+ * @return a new XQItemType representing the atomic type
+ * @throw
+ */
@Override
public XQItemType createAtomicType(int basetype) throws XQException {
isClosedXQException();
@@ -1288,6 +1629,22 @@
return type;
}
+ /** \brief Creates a new XQItemType object representing an XQuery atomic type.
+ *
+ * The item kind of the item type will be XQItemType.XQITEMKIND_ATOMIC.
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ...;
+ *
+ * // to create xs:integer item type
+ * conn.createAtomicType(XQItemType.XQBASETYPE_INTEGER);
+ * \endcode
+ * @param basetype - one of the XQItemType.XQBASETYPE_* constants. All basetype constants except the following are valid:<br />XQItemType.XQBASETYPE_UNTYPED<br />XQItemType.XQBASETYPE_ANYTYPE<br />XQItemType.XQBASETYPE_IDREFS<br />XQItemType.XQBASETYPE_NMTOKENS<br />XQItemType.XQBASETYPE_ENTITIES<br />XQItemType.XQBASETYPE_ANYSIMPLETYPE<br />
+ * @param typename - the QName of the type. If the QName refers to a predefinied type, it must match the basetype. Can be null
+ * @param schemaURI - the URI to the schema. Can be null. This can only be specified if the typename is also specified
+ * @return a new XQItemType representing the atomic type
+ * @throw
+ */
@Override
public XQItemType createAtomicType(int basetype, QName qname, URI uri) throws XQException {
if (closed) {
@@ -1305,6 +1662,41 @@
return type;
}
+ /** \brief Creates a new XQItemType object representing the XQuery attribute(nodename, basetype) type with the given node name and base type.
+ *
+ * This method can be used to create item type for attributes with a pre-defined schema type.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ *
+ * - attribute() // no node name, pass null for the node name
+ *
+ * conn.createAttributeType(null, XQItemType.XQBASETYPE_ANYSIMPLETYPE);
+ *
+ * - attribute (*) // equivalent to attribute()
+ *
+ * conn.createAttributeType(null, XQItemType.XQBASETYPE_ANYSIMPLETYPE);
+ *
+ * - attribute (person) // attribute of name person and any simple type.
+ *
+ * conn.createAttributeType(new QName("person"), XQItemType.XQBASETYPE_ANYSIMPLETYPE);
+ *
+ * - attribute(foo:bar) // node name foo:bar, type is any simple type
+ *
+ * conn.createAttributeType(new QName("http://www.foo.com", "bar","foo"),
+ * XQItemType.XQBASETYPE_ANYSIMPLETYPE);
+ *
+ * - attribute(foo:bar, xs:integer) // node name foo:bar, type is xs:integer
+ *
+ * conn.createAttributeType(new QName("http://www.foo.com", "bar","foo"),
+ * XQItemType.XQBASETYPE_INTEGER);
+ * \endcode
+ * @param nodename - specifies the name of the node.null indicates a wildcard for the node name
+ * @param basetype - the base type of the attribute. One of the XQItemType.XQBASETYPE_* other than XQItemType.XQBASETYPE_UNTYPED or XQItemType.XQBASETYPE_ANYTYPE
+ * @return a new XQItemType representing the XQuery attribute(nodename, basetype) type
+ * @throw XQException - if (1) the underlying object implementing the interface is closed or (2) if the base type is one of: XQItemType.XQBASETYPE_UNTYPED or XQItemType.XQBASETYPE_ANYTYPE
+ */
@Override
public XQItemType createAttributeType(QName nodename, int basetype) throws XQException {
isClosedXQException();
@@ -1314,6 +1706,50 @@
return new org.zorbaxquery.api.xqj.XQItemType(XQItemType.XQITEMKIND_ATTRIBUTE, nodename, basetype);
}
+ /** \brief Creates a new XQItemType object representing the XQuery attribute(nodename, basetype) type with the given node name and base type.
+ *
+ * The type name can reference either pre-defined simple types or user-defined simple types.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ *
+ * - attribute (name, employeename) // attribute name of type employeename
+ *
+ * conn.createAttributeType(new QName("name"), XQItemType.XQBASETYPE_ANYSIMPLETYPE,
+ * new QName("employeename"), null);
+ *
+ * - attribute (foo:bar, po:city)
+ * where the prefix foo refers to the namespace http://www.foo.com and the
+ * prefix po refers to the namespace "http://www.address.com"
+ *
+ * conn.createAttributeType(new QName("http://www.foo.com", "bar","foo"),
+ * XQItemType.XQBASETYPE_ANYSIMPLETYPE,
+ * new QName("http://address.com", "address","po"), null);
+ *
+ * - attribute (zip, zipcode) // attribute zip of type zipchode which derives from
+ * // xs:string
+ *
+ * conn.createAttributeType(new QName("zip"), XQItemType.XQBASETYPE_STRING,
+ * new QName("zipcode"), null);
+ *
+ * - attribute(foo:bar, po:hatsize)
+ * where the prefix foo refers to the namespace http://www.foo.com and the
+ * prefix po refers to the namespace "http://www.hatsizes.com"
+ * with schema URI "http://hatschema.com"
+ *
+ * conn.createAttributeType(new QName("http://www.foo.com", "bar","foo"),
+ * XQItemType.XQBASETYPE_INTEGER,
+ * new QName("http://www.hatsizes.com", "hatsize","po"),
+ * new QName("http://hatschema.com"));
+ * \endcode
+ * @param nodename - specifies the name of the node.null indicates a wildcard for the node name
+ * @param basetype - the base type of the attribute. One of the XQItemTyupe.XQBASETYPE_* constants other than XQItemType.XQBASETYPE_UNTYPED or XQItemType.XQBASETYPE_ANYTYPE
+ * @param typename - the QName of the type. If the QName refers to a predefinied type, it must match the basetype. Can be null.
+ * @param schemaURI - the URI to the schema. Can be null. This can only be specified if the typename is also specified
+ * @return a new XQItemType representing the XQuery attribute(nodename,basetype, typename,schemaURI) type.
+ * @throw XQException - if (1) the underlying object implementing the interface is closed, (2) if the base type is one of: XQItemType.XQBASETYPE_UNTYPED or XQItemType.XQBASETYPE_ANYTYPE, (3) the schema URI is specified and the typename is not specified, (4) the implementation does not support user-defined XML schema types, or (5) if the typename refers to a predefinied type and does not match basetype
+ */
@Override
public XQItemType createAttributeType(QName nodename, int basetype, QName typename, URI schemaURI) throws XQException {
isClosedXQException();
@@ -1326,18 +1762,67 @@
return new org.zorbaxquery.api.xqj.XQItemType(XQItemType.XQITEMKIND_ATTRIBUTE, nodename, basetype, typename, schemaURI, true);
}
+ /** \brief Creates a new XQItemType object representing the XQuery schema-attribute(nodename,basetype,schemaURI) type, with the given node name, base type, and schema URI.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ *
+ * - schema-attribute (name) // schema-attribute name, found in the schema
+ * // available at http://customerschema.com
+ *
+ * conn.createSchemaAttributeType(new QName("name"),
+ * XQItemType.XQBASETYPE_STRING,
+ * new URI(http://customerschema.com));
+ * \endcode
+ *
+ * @param nodename - specifies the name of the node
+ * @param basetype - the base type of the attribute. One of the XQItemTyupe.XQBASETYPE_* constants other than XQItemType.XQBASETYPE_UNTYPED or XQItemType.XQBASETYPE_ANYTYPE
+ * @param schemaURI - the URI to the schema. Can be null
+ * @return a new XQItemType representing the XQuery schema-attribute(nodename,basetype, schemaURI) type
+ * @throw XQException - if (1) the node name is null, (2) if the base type is one of: XQItemType.XQBASETYPE_UNTYPED or XQItemType.XQBASETYPE_ANYTYPE, (3) the underlying object implementing the interface is closed, or (4) the implementation does not support user-defined XML schema types
+ */
@Override
public XQItemType createSchemaAttributeType(QName nodename, int basetype, URI uri) throws XQException {
isClosedXQException();
return new org.zorbaxquery.api.xqj.XQItemType(XQItemType.XQITEMKIND_SCHEMA_ATTRIBUTE, nodename, basetype, uri);
}
+ /** \brief Creates a new XQItemType object representing the XQuery comment() type.
+ *
+ * Creates a new XQItemType object representing the XQuery comment() type. The XQItemType object will have the item kind set to XQItemType.XQITEMKIND_COMMENT.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ * XQItemType cmttype = conn.createCommentType();
+ *
+ * int itemkind = cmttype.getItemKind(); // will be XQItemType.XQITEMKIND_COMMENT
+ *
+ * XQExpression expr = conn.createExpression();
+ * XQSequence result = expr.executeQuery("<!-- comments -->");
+ *
+ * result.next();
+ * boolean pi = result.instanceOf(cmttype); // will be true
+ * \endcode
+ *
+ * @return a new XQItemType representing the XQuery comment() type
+ * @throw XQException - if the underlying object implementing the interface is closed
+ */
@Override
public XQItemType createCommentType() throws XQException {
isClosedXQException();
return new org.zorbaxquery.api.xqj.XQItemType(XQItemType.XQITEMKIND_COMMENT);
}
+ /** \brief Creates a new XQItemType object representing the XQuery document-node(elementType) type containing a single element.
+ *
+ * Creates a new XQItemType object representing the XQuery document-node(elementType) type containing a single element. The XQItemType object will have the item kind set to XQItemType.XQITEMKIND_DOCUMENT_ELEMENT and the base type set to the item type of the input elementType.
+ *
+ * @param elementType - an XQItemType object representing an XQuery element() type, cannot be null
+ * @return a new XQItemType representing the XQuery document-node(elementType) type containing a single element
+ * @throw XQException - if (1) the underlying object implementing the interface is closed or (2) the elementType has an item kind different from XQItemType.XQITEMKIND_ELEMENT, (3) the elementType argument is null, or (4) the implementation does not support user-defined XML schema types
+ */
@Override
public XQItemType createDocumentElementType(XQItemType elementType) throws XQException {
isClosedXQException();
@@ -1348,6 +1833,14 @@
return new org.zorbaxquery.api.xqj.XQItemType(XQItemType.XQITEMKIND_DOCUMENT_ELEMENT, elementType.getNodeName(), elementType.getBaseType(), elementType.getSchemaURI());
}
+ /** \brief Creates a new XQItemType object representing the XQuery document-node(elementType) type containing a single schema-element(...).
+ *
+ * The XQItemType object will have the item kind set to XQItemType.XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT and the base type set to the item type of the input elementType.
+ *
+ * @param elementType - an XQItemType object representing an XQuery schema-element(...) type, cannot be null
+ * @return a new XQItemType representing the XQuery document-node(elementType) type containing a single schema-element(...) element
+ * @throw XQException - if (1) the underlying object implementing the interface is closed or (2) the elementType has an item kind different from XQItemType.XQITEMKIND_SCHEMA_ELEMENT, (3) the elementType argument is null, (4) the implementation does not support user-defined XML schema types
+ */
@Override
public XQItemType createDocumentSchemaElementType(XQItemType elementType) throws XQException {
isClosedXQException();
@@ -1357,12 +1850,53 @@
return new org.zorbaxquery.api.xqj.XQItemType(XQItemType.XQITEMKIND_DOCUMENT_ELEMENT, elementType.getNodeName(), elementType.getBaseType(), elementType.getSchemaURI());
}
+ /** \brief Creates a new XQItemType object representing the XQuery document-node() type.
+ *
+ * The XQItemType object will have the item kind set to XQItemType.XQITEMKIND_DOCUMENT.
+ *
+ * @return a new XQItemType representing the XQuery document-node() type
+ * @throw XQException - if the underlying object implementing the interface is closed
+ */
@Override
public XQItemType createDocumentType() throws XQException {
isClosedXQException();
return new org.zorbaxquery.api.xqj.XQItemType(XQItemType.XQITEMKIND_DOCUMENT);
}
+ /** \brief Creates a new XQItemType object representing the XQuery element(nodename, basetype) type, with the given node name and base type.
+ *
+ * This method can be used to create item type for elements with a pre-defined schema type.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ * - element() // no node name, pass null for the node name
+ *
+ * conn.createElementType(null, XQItemType.XQBASETYPE_ANYTYPE);
+ *
+ * - element (*) // equivalent to element()
+ *
+ * conn.createElementType(null, XQItemType.XQBASETYPE_ANYTYPE);
+ *
+ * - element(person) // element of name person and any type.
+ *
+ * conn.createElementType(new QName("person"), XQItemType.XQBASETYPE_ANYTYPE);
+ *
+ * - element(foo:bar) // node name foo:bar, type is anytype
+ *
+ * conn.createElementType(new QName("http://www.foo.com", "bar","foo"),
+ * XQItemType.XQBASETYPE_ANYTYPE);
+ *
+ * - element(foo:bar, xs:integer) // node name foo:bar, type is xs:integer
+ *
+ * conn.createElementType(new QName("http://www.foo.com", "bar","foo"),
+ * XQItemType.XQBASETYPE_INTEGER);
+ * \endcode
+ * @param nodename - specifies the name of the node. null indicates a wildcard for the node name
+ * @param basetype - the base type of the item. One of the XQItemType.XQBASETYPE_* constants
+ * @return a new XQItemType representing the XQuery element(nodename, basetype) type
+ * @throw XQException - if (1) the underlying object implementing the interface is closed
+ */
@Override
public XQItemType createElementType(QName nodename, int baseType) throws XQException {
isClosedXQException();
@@ -1370,6 +1904,63 @@
return item;
}
+ /** \brief Creates a new XQItemType object representing the XQuery element(nodename,basetype,typename,schemaURI, allowNill) type, given the node name, base type, schema type name, schema URI, and nilled check.
+ *
+ * The type name can reference either pre-defined schema types or user-defined types.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ *
+ * - element (person, employee) // element person of type employee
+ *
+ * conn.createElementType(new QName("person"), XQItemType.XQBASETYPE_ANYTYPE,
+ * new QName("employee"), null ,false);
+ *
+ * - element(person, employee ? ) // element person of type employee, whose nilled
+ * // property may be true or false.
+ *
+ * conn.createElementType(new QName("person"), XQItemType.XQBASETYPE_ANYTYPE,
+ * new QName("employee"), null ,true);
+ *
+ * - element(foo:bar, po:address)
+ * where the prefix foo refers to the namespace http://www.foo.com and the
+ * prefix po refers to the namespace "http://www.address.com"
+ *
+ * conn.createElementType(new QName("http://www.foo.com", "bar","foo"),
+ * XQItemType.XQBASETYPE_ANYTYPE,
+ * new QName("http://address.com", "address","po"), null, false);
+ *
+ * - element (zip, zipcode) // element zip of type zipchode which derives from
+ * // xs:string
+ *
+ * conn.createElementType(new QName("zip"), XQItemType.XQBASETYPE_STRING,
+ * new QName("zipcode"), null, false);
+ *
+ * - element (*, xs:anyType ?)
+ *
+ * conn.createElementType(null, XQItemType.XQBASETYPE_ANYTYPE, null, null, true);
+ *
+ * - element(foo:bar, po:hatsize)
+ * where the prefix foo refers to the namespace http://www.foo.com and the
+ * prefix po refers to the namespace "http://www.hatsizes.com"
+ * with schema URI "http://hatschema.com"
+ *
+ * conn.createElementType(new QName("http://www.foo.com", "bar","foo"),
+ * XQItemType.XQBASETYPE_INTEGER,
+ * new QName("http://www.hatsizes.com", "hatsize","po"),
+ * new QName("http://hatschema.com"), false);
+ *
+ * \endcode
+ *
+ * @param nodename - specifies the name of the element. null indicates a wildcard for the node name
+ * @param basetype - the base type of the item. One of the XQItemType.XQBASETYPE_* constants
+ * @param typename - the QName of the type. If the QName refers to a predefinied type, it must match the basetype. Can be null
+ * @param schemaURI - the URI to the schema. Can be null. This can only be specified if the typename is also specified
+ * @param allowNill - the nilled property of the element
+ * @return a new XQItemType representing the XQuery element(nodename,basetype, typename,schemaURI, allowNill) type
+ * @throw XQException - if (1) schemaURI is specified but the typename is not specified, (2) the underlying object implementing the interface is closed, (3) the implementation does not support user-defined XML schema types, or (4) if the typename refers to a predefinied type and does not match basetype
+ */
@Override
public XQItemType createElementType(QName nodename, int baseType, QName typename, URI schemaURI, boolean allowNill) throws XQException {
isClosedXQException();
@@ -1377,6 +1968,24 @@
return item;
}
+ /** \brief Creates a new XQItemType object representing the XQuery schema-element(nodename,basetype,schemaURI) type, given the node name, base type, and the schema URI.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ *
+ * - schema-element (customer) // schema-element person, found in
+ * // the schema available at http://customerschema.com
+ *
+ * conn.createElementType(new QName("customer"), XQItemType.XQBASETYPE_ANYTYPE,
+ * new URI("http://customerschema.com"));
+ * \endcode
+ * @param nodename - specifies the name of the element
+ * @param basetype - the base type of the item. One of the XQItemType.XQBASETYPE_* constants
+ * @param schemaURI - the URI to the schema. Can be null
+ * @return a new XQItemType representing the XQuery schema-element(nodename,basetype, schemaURI) type
+ * @throw XQException - if (1) the node name is null, (2) the underlying object implementing the interface is closed, or (3) the implementation does not support user-defined XML schema types
+ */
@Override
public XQItemType createSchemaElementType(QName nodename, int baseType, URI schemaURI) throws XQException {
isClosedXQException();
@@ -1384,6 +1993,18 @@
return item;
}
+ /** \brief Creates a new XQItemType object representing the XQuery item type.
+ *
+ * The XQItemType object will have the item kind set to XQItemType.XQITEMKIND_ITEM.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ * XQItemType typ = conn.createItemType(); // represents the XQuery item type "item()"
+ * \endcode
+ * @return a new XQItemType representing the XQuery item type
+ * @throw XQException - if the underlying object implementing the interface is closed
+ */
@Override
public XQItemType createItemType() throws XQException {
isClosedXQException();
@@ -1391,6 +2012,13 @@
return type;
}
+ /** \brief Creates a new XQItemType object representing the XQuery node() type.
+ *
+ * The XQItemType object will have the item kind set to XQItemType.XQITEMKIND_NODE.
+ *
+ * @return a new XQItemType representing the XQuery node() type
+ * @throw XQException - if the underlying object implementing the interface is closed
+ */
@Override
public XQItemType createNodeType() throws XQException {
isClosedXQException();
@@ -1398,6 +2026,35 @@
return type;
}
+ /** \brief Creates a new XQItemType object representing the XQuery processing-instruction(piTarget) type.
+ *
+ * The XQItemType object will have the item kind set to XQItemType.XQITEMKIND_PI. A string literal can be passed to match the PITarget of the processing instruction as described in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = ..; // An XQuery connection
+ * XQItemType anypi = conn.createProcessingInstructionType();
+ * XQItemType foopi = conn.createProcessingInstructionType("foo-format");
+ *
+ * XQExpression expr = conn.createExpression();
+ * XQSequence result = expr.executeQuery("<?format role="output" ?>");
+ *
+ * result.next();
+ * boolean pi = result.instanceOf(anypi); // will be true
+ * pi = result.instanceOf(foopi); // will be false
+ *
+ * XQExpression expr = conn.createExpression();
+ * XQSequence result = expr.executeQuery("<?foo-format role="output" ?>");
+ *
+ * result.next();
+ * boolean pi = result.instanceOf(anypi); // will be true
+ * pi = result.instanceOf(foopi); // will be true
+ * \endcode
+ *
+ * @param piTarget - the string literal to match the processing instruction's PITarget. A null string value will match all processing instruction nodes
+ * @return a new XQItemType representing the XQuery processing-instruction(piTarget) type
+ * @throw XQException - if the underlying object implementing the interface is closed
+ */
@Override
public XQItemType createProcessingInstructionType(String piTarget) throws XQException {
isClosedXQException();
@@ -1405,6 +2062,13 @@
return type;
}
+ /** \brief Creates a new sequence type from an item type and occurence indicator.
+ *
+ * @param item - the item type. This parameter must be null if the occurance is XQSequenceType.OCC_EMPTY, and cannot be null for any other occurance indicator
+ * @param occurence - The occurence of the item type, must be one of XQSequenceType.OCC_ZERO_OR_ONE, XQSequenceType.OCC_EXACTLY_ONE, XQSequenceType.OCC_ZERO_OR_MORE, XQSequenceType.OCC_ONE_OR_MORE, XQSequenceType.OCC_EMPTY
+ * @return a new XQSequenceType representing the type of a sequence
+ * @throw XQException - if (1) the item is null and the occurance is not XQSequenceType.OCC_EMPTY, (2) the item is not null and the occurance is XQSequenceType.OCC_EMPTY, (3) the occurence is not one of: XQSequenceType.OCC_ZERO_OR_ONE, XQSequenceType.OCC_EXACTLY_ONE, XQSequenceType.OCC_ZERO_OR_MORE, XQSequenceType.OCC_ONE_OR_MORE, XQSequenceType.OCC_EMPTY or (4) the underlying object implementing the interface is closed
+ */
@Override
public XQSequenceType createSequenceType(XQItemType item, int occurence) throws XQException {
isClosedXQException();
@@ -1423,6 +2087,13 @@
return result;
}
+ /** \brief Creates a new XQItemType object representing the XQuery text() type.
+ *
+ * The XQItemType object will have the item kind set to XQItemType.XQITEMKIND_TEXT.
+ *
+ * @return a new XQItemType representing the XQuery text() type
+ * @throw XQException - if the underlying object implementing the interface is closed
+ */
@Override
public XQItemType createTextType() throws XQException {
isClosedXQException();
=== modified file 'swig/xqj/XQDataSource.java'
--- swig/xqj/XQDataSource.java 2012-04-19 23:07:13 +0000
+++ swig/xqj/XQDataSource.java 2012-05-14 18:27:25 +0000
@@ -21,6 +21,9 @@
import java.util.Properties;
import javax.xml.xquery.*;
+ /**
+ * An XQDataSource is a factory for XQConnection objects.
+ */
public class XQDataSource implements javax.xml.xquery.XQDataSource {
static {
@@ -37,7 +40,12 @@
public XQDataSource() {
}
-
+
+ /** \brief Attempts to create a connection to an XML datasource.
+ *
+ * @return a connection to the XML datasource
+ * @throw XQException - if a datasource access error occurs
+ */
@Override
public XQConnection getConnection() throws XQException {
XQConnection conn;
@@ -53,6 +61,14 @@
return conn;
}
+ /** \brief Attempts to create a connection to an XML datasource using an existing JDBC connection.
+ *
+ * An XQJ implementation is not required to support this method. If it is not supported, then an exception (XQException) is thrown. The XQJ and JDBC connections will operate under the same transaction context.
+ *
+ * @param cnctn - an existing JDBC connection
+ * @return a connection to the XML datasource
+ * @throw XQException - if (1) a datasource access error occurs, (2) the implementation does not support this method of getting an XQConnection, or (3) if the con parameter is null
+ */
@Override
public XQConnection getConnection(Connection cnctn) throws XQException {
/* Attempts to create a connection to an XML datasource using an
@@ -64,6 +80,13 @@
throw new XQException("Connection to an XML datasource using an existing JDBC connection is not supported.");
}
+ /** \brief Attempts to establish a connection to an XML datasource using the supplied username and password.
+ *
+ * @param username - the user on whose behalf the connection is being made
+ * @param passwd - the user's password
+ * @return a connection to the XML datasource
+ * @throw XQException - if a datasource access error occurs
+ */
@Override
public XQConnection getConnection(String username, String passwd) throws XQException {
XQConnection conn;
@@ -79,21 +102,55 @@
return conn;
}
+ /** \brief Gets the maximum time in seconds that this datasource can wait while attempting to connect to a database.
+ *
+ * A value of zero means that the timeout is the default system timeout if there is one; otherwise, it means that there is no timeout. When a XQDataSource object is created, the login timeout is initially zero. It is implementation-defined whether the returned login timeout is actually used by the data source implementation.
+ *
+ * @return the datasource login time limit
+ * @throw XQException - if a datasource access error occurs
+ */
@Override
public int getLoginTimeout() throws XQException {
return loginTimeout;
}
+ /** \brief Retrieves the log writer for this XQDataSource object.
+ *
+ * The log writer is a character output stream to which all logging and tracing messages for this datasource will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. When a XQDataSource object is created, the log writer is initially null; in other words, the default is for logging to be disabled.
+ *
+ * @return the log writer for this datasource or null if logging is disabled
+ * @throw XQException - if a datasource access error occurs
+ */
@Override
public PrintWriter getLogWriter() throws XQException {
return logWriter;
}
+ /** \brief Returns an array containing the property names supported by this XQDataSource.
+ *
+ * Implementations that support user name and password must recognize the user name and password properties listed below.
+ *
+ * user the user name to use for creating a connection
+ * password the password to use for creating a connection
+ *
+ * Any additional properties are implementation-defined.
+ *
+ * @return String[] an array of property names supported by this implementation
+ */
@Override
public String[] getSupportedPropertyNames() {
return propertiesAllowed;
}
+ /** \brief Sets the named property to the specified value.
+ *
+ * If a property with the same name was already set, then this method will override the old value for that property with the new value.
+ * If the implementation does not support the given property or if it can determine that the value given for this property is invalid, then an exception is thrown. If an exception is thrown, then no previous value is overwritten.
+ *
+ * @param name - the name of the property to set
+ * @param value - the value of the named property
+ * @throw XQException - if (1) the given property is not recognized, (2) the value for the given property is determined to be invalid, or (3) the name parameter is null
+ */
@Override
public void setProperty(String name, String value) throws XQException {
if (name==null) {
@@ -112,6 +169,14 @@
}
}
+ /** \brief Returns the current value of the named property if set, else null.
+ *
+ * If the implementation does not support the given property then an exception is raised.
+ *
+ * @param name - the name of the property whose value is needed
+ * @return String representing the value of the required property if set, else null
+ * @throw XQException - if (1) a given property is not supported, or (2) the name parameter is null
+ */
@Override
public String getProperty(String name) throws XQException {
if (name==null) {
@@ -129,6 +194,14 @@
return properties.getProperty(name);
}
+ /** \brief Sets the data source properties from the specified Properties instance.
+ *
+ * Properties set before this call will still apply but those with the same name as any of these properties will be replaced. Properties set after this call also apply and may replace properties set during this call.
+ * If the implementation does not support one or more of the given property names, or if it can determine that the value given for a specific property is invalid, then an exception is thrown. If an exception is thrown, then no previous value is overwritten. is invalid, then an exception is raised.
+ *
+ * @param prprts - the list of properties to set
+ * @throw XQException - if (1) a given property is not recognized, (2) the value for a given property is determined to be invalid, or (3) the props parameter is null
+ */
@Override
public void setProperties(Properties prprts) throws XQException {
if (prprts==null) {
@@ -158,11 +231,25 @@
}
+ /** \brief Sets the maximum time in seconds that this datasource will wait while attempting to connect to a database.
+ *
+ * A value of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout. When a XQDataSource object is created, the login timeout is initially zero. It is implementation-defined whether the specified login timeout is actually used by the data source implementation. If the connection is created over an existing JDBC connection, then the login timeout value from the underlying JDBC connection may be used.
+ *
+ * @param seconds - the datasource login time limit
+ * @throw XQException - if a datasource access error occurs
+ */
@Override
- public void setLoginTimeout(int i) throws XQException {
- loginTimeout = i;
+ public void setLoginTimeout(int seconds) throws XQException {
+ loginTimeout = seconds;
}
+ /** \brief Sets the log writer for this XQDataSource object to the given java.io.PrintWriter object.
+ *
+ * The log writer is a character output stream to which all logging and tracing messages for this datasource will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. When a XQDataSource object is created the log writer is initially null; in other words, the default is for logging to be disabled.
+ *
+ * @param writer - the new log writer; to disable logging, set to null
+ * @throw XQException - if a datasource access error occurs
+ */
@Override
public void setLogWriter(PrintWriter writer) throws XQException {
logWriter = writer;
=== modified file 'swig/xqj/XQExpression.java'
--- swig/xqj/XQExpression.java 2012-04-19 23:07:13 +0000
+++ swig/xqj/XQExpression.java 2012-05-14 18:27:25 +0000
@@ -41,6 +41,42 @@
import org.zorbaxquery.api.Item;
import org.zorbaxquery.api.XQuery;
+/**
+ * This interface describes the execute immediate functionality for expressions. This object can be created from the XQConnection and the execution can be done using the executeQuery() or executeCommand() method, passing in the XQuery expression.
+ *
+ * All external variables defined in the prolog of the expression to be executed must be set in the dynamic context of this expression using the bind methods. Also, variables bound in this expression but not defined as external in the prolog of the expression to be executed, are simply ignored. For example, if variables $var1 and $var2 are bound, but the query only defines $var1 as external, no error will be reported for the binding of $var2. It will simply be ignored. When the expression is executed using the executeQuery method, if the execution is successful, then an XQResultSequence object is returned. The XQResultSequence object is tied to the XQExpression from which it was prepared and is closed implicitly if that XQExpression is either closed or re-executed.
+ *
+ * The XQExpression object is dependent on the XQConnection object from which it was created and is only valid for the duration of that object. Thus, if the XQConnection object is closed then this XQExpression object will be implicitly closed and it can no longer be used.
+ *
+ * An XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call close method explicitly to free any resources. It is also recommended that they do so under a final block to ensure that the object is closed even when there are exceptions. Not closing this object implicitly or explicitly might result in serious memory leaks.
+ *
+ * When the XQExpression is closed any XQResultSequence object obtained from it is also implicitly closed.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = XQDatasource.getConnection();
+ * XQExpression expr = conn.createExpression();
+ *
+ * expr.bindInt(new QName("x"), 21, null);
+ *
+ * XQSequence result = expr.executeQuery(
+ * "declare variable $x as xs:integer external;
+ * for $i in $x return $i");
+ *
+ * while (result.next())
+ * {
+ * // process results ...
+ * }
+ *
+ * // Execute some other expression on the same object
+ * XQSequence result = expr.executeQuery("for $i in doc('foo.xml') return $i");
+ * ...
+ *
+ * result.close(); // close the result
+ * expr.close();
+ * conn.close();
+ * \endcode
+ */
public class XQExpression implements javax.xml.xquery.XQExpression {
//private XQuery query;
@@ -66,39 +102,75 @@
connection = conn;
staticContext = sc;
}
-
+
+ /** \brief Attempts to cancel the execution if both the XQuery engine and XQJ driver support aborting the execution of an XQExpression.
+ *
+ * This method can be used by one thread to cancel an XQExpression, that is being executed in another thread. If cancellation is not supported or the attempt to cancel the execution was not successful, the method returns without any error. If the cancellation is successful, an XQException is thrown, to indicate that it has been aborted, by executeQuery, executeCommand or any method accessing the XQResultSequence returned by executeQuery. If applicable, any open XQResultSequence and XQResultItem objects will also be implicitly closed in this case.
+ *
+ * @throw XQException - if the expression is in a closed state
+ */
@Override
public void cancel() throws XQException {
isClosedXQException();
cancel = true;
}
+ /** \brief Checks if the expression is in a closed state.
+ *
+ * @return true if the expression is in a closed state, false otherwise
+ */
@Override
public boolean isClosed() {
return closed;
}
- @Override
+
+ /** \brief Closes the expression object and release associated resources.
+ *
+ * Once the expression is closed, all methods on this object other than the close or isClosed will raise exceptions. This also closes any result sequences obtained from this expression. Calling close on an XQExpression object that is already closed has no effect.
+ *
+ * @throw XQException - if there are errors when closing the expression
+ */
+ @Override
public void close() throws XQException {
closed=true;
-// if (query!=null) {
-// query.destroy();
-// }
for (XQResultSequence rs: resultSequences) {
rs.close();
}
}
+ /** \brief Executes an implementation-defined command.
+ *
+ * Calling this method implicitly closes any previous result sequence obtained from this expression.
+ *
+ * @param string - the input command as a string
+ * @throw XQException - if (1) there are errors when executing the command, or (2) the expression is in a closed state
+ */
@Override
public void executeCommand(String string) throws XQException {
throw new UnsupportedOperationException("Not supported yet.");
}
+ /** \brief Executes an implementation-defined command.
+ *
+ * Calling this method implicitly closes any previous result sequence obtained from this expression.
+ *
+ * @param reader - the input command as a reader
+ * @throw XQException - if (1) there are errors when executing the command, or (2) the expression is in a closed state
+ */
@Override
public void executeCommand(Reader reader) throws XQException {
throw new UnsupportedOperationException("Not supported yet.");
}
+ /** \brief Executes a query expression.
+ *
+ * This implicitly closes any previous result sequences obtained from this expression.
+ *
+ * @param value - the input query expression string. Cannot be null
+ * @return an XQResultSequence object containing the result of the query execution
+ * @throw XQException - if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, (4) the query parameter is null
+ */
@Override
public XQResultSequence executeQuery(String value) throws XQException {
isClosedXQException();
@@ -135,6 +207,14 @@
return result;
}
+ /** \brief Executes a query expression.
+ *
+ * This implicitly closes any previous result sequences obtained from this expression.
+ *
+ * @param value - the input query expression reader object. Cannot be null
+ * @return an XQResultSequence object containing the result of the query execution
+ * @throw XQException - if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, (4) the query parameter is null
+ */
@Override
public XQResultSequence executeQuery(Reader value) throws XQException {
isClosedXQException();
@@ -158,6 +238,14 @@
return executeQuery(writer.toString());
}
+ /** \brief Executes a query expression.
+ *
+ * This implicitly closes any previous result sequences obtained from this expression.
+ *
+ * @param value - the input query expression inputstream object. Cannot be null
+ * @return an XQResultSequence object containing the result of the query execution
+ * @throw XQException - if (1) there are errors when executing the query, (2) the expression is in a closed state, (3) the execution is cancelled, (4) the query parameter is null
+ */
@Override
public XQResultSequence executeQuery(InputStream value) throws XQException {
isClosedXQException();
@@ -174,6 +262,13 @@
return executeQuery(out.toString());
}
+ /** \brief Gets an XQStaticContext representing the values for all expression properties.
+ *
+ * Note that these properties cannot be changed; in order to change, a new XQExpression needs to be created.
+ *
+ * @return an XQStaticContext representing the values for all expression properties
+ * @throw XQException - if the expression is in a closed state
+ */
@Override
public XQStaticContext getStaticContext() throws XQException {
isClosedXQException();
@@ -184,6 +279,11 @@
}
}
+ /** \brief Gets the implicit timezone
+ *
+ * @return the implicit timezone. This may have been set by an application using the setImplicitTimeZone method or provided by the implementation
+ * @throw XQException - if the expression is in a closed state
+ */
@Override
public TimeZone getImplicitTimeZone() throws XQException {
isClosedXQException();
@@ -197,6 +297,15 @@
return result;
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the casting from xs:string rules outlined in 17.1.1 Casting from xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators. If the cast fails, or if there is a mismatch between the static and dynamic types, an XQException is thrown either by this method or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to
+ * @param value - the lexical string value of the type
+ * @param type - the item type of the bind
+ * @throw XQException - if (1) any of the arguments are null, (2) given type is not an atomic type, (3) the conversion of the value to an XDM instance failed, (4) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (5) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (6) the expression is in a closed state
+ */
@Override
public void bindAtomicValue(QName varName, String value, XQItemType type) throws XQException {
isClosedXQException();
@@ -210,6 +319,16 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type, which must represent an xs:string or a type derived by restriction from xs:string. If the specified type is null, it defaults to xs:string.
+ * Subsequently the value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0,. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type, xs:string, is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindString(QName varName, String value, XQItemType type) throws XQException {
isClosedXQException();
@@ -223,6 +342,20 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, String value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -236,6 +369,20 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, Reader value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -249,6 +396,20 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, InputStream value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -262,6 +423,20 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, XMLStreamReader value, XQItemType type) throws XQException {
isClosedXQException();
@@ -275,6 +450,25 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMSource
+ * - javax.xml.transform.sax.SAXSource
+ * - javax.xml.transform.stream.StreamSource
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, Source value, XQItemType type) throws XQException {
isClosedXQException();
@@ -288,6 +482,11 @@
}
}
+ /** \brief Sets the implicit timezone
+ *
+ * @param implicitTimeZone - time zone to be set
+ * @throw XQException - if the expression is in a closed state
+ */
@Override
public void setImplicitTimeZone(TimeZone value) throws XQException {
isClosedXQException();
@@ -299,6 +498,14 @@
}
}
+ /** \brief Binds a value to the given external variable.
+ *
+ * The dynamic type of the value is derived from the XQItem. In case of a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @throw XQException - if (1) any of the arguments are null, (2) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (3) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, (4) the expression is in a closed state, or (5) the specified item is closed
+ */
@Override
public void bindItem(QName varName, XQItem value) throws XQException {
isClosedXQException();
@@ -311,6 +518,14 @@
}
}
+ /** \brief Binds a value to the given external variable.
+ *
+ * The input sequence is consumed from its current position to the end, after which the input sequence's position will be set to point after the last item. The dynamic type of the value is derived from the items in the sequence. In case of a mismatch between the static and dynamic types, an XQException is be raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @throw XQException - if (1) any of the arguments are null, (2) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (3) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, (4) the expression is in a closed state, or (5) the specified item is closed
+ */
@Override
public void bindSequence(QName varName, XQSequence value) throws XQException {
isClosedXQException();
@@ -324,6 +539,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindObject(QName varName, Object value, XQItemType type) throws XQException {
isClosedXQException();
@@ -342,6 +566,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindBoolean(QName varName, boolean value, XQItemType type) throws XQException {
isClosedXQException();
@@ -354,6 +587,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindByte(QName varName, byte value, XQItemType type) throws XQException {
isClosedXQException();
@@ -366,6 +608,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDouble(QName varName, double value, XQItemType type) throws XQException {
isClosedXQException();
@@ -378,6 +629,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindFloat(QName varName, float value, XQItemType type) throws XQException {
isClosedXQException();
@@ -390,6 +650,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindInt(QName varName, int value, XQItemType type) throws XQException {
isClosedXQException();
@@ -402,6 +671,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindLong(QName varName, long value, XQItemType type) throws XQException {
isClosedXQException();
@@ -414,6 +692,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindNode(QName varName, Node value, XQItemType type) throws XQException {
isClosedXQException();
@@ -427,6 +714,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindShort(QName varName, short value, XQItemType type) throws XQException {
isClosedXQException();
=== modified file 'swig/xqj/XQItem.java'
--- swig/xqj/XQItem.java 2012-04-19 23:07:13 +0000
+++ swig/xqj/XQItem.java 2012-05-14 18:27:25 +0000
@@ -51,6 +51,47 @@
import org.zorbaxquery.api.StringPair;
import org.zorbaxquery.api.StringPairVector;
+/**
+ * This class represents an item in the XDM.
+ * This class also implements the common interface XQItemAccessor for accessing the values of an XQuery item. All the get functions raise an exception if the underlying sequence object is not positioned on an item (e.g. if the sequence is positioned before the first item or after the last item).
+ *
+ * Example -
+ *
+ * \code{.java}
+ * XQPreparedExpression expr = conn.prepareExpression("for $i ..");
+ * XQSequence result = expr.executeQuery();
+ *
+ * // create the ItemTypes for string and integer
+ * XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ * XQItemType intType = conn.createAtomicType(XQItemType.XQBASETYPE_INTEGER);
+ *
+ * // posititioned before the first item
+ * while (result.next())
+ * {
+ * // If string or any of its subtypes, then get the string value out
+ *
+ * if (result.instanceOf(strType))
+ * String str = result.getAtomicValue();
+ * else if (result.instanceOf(intType))
+ * // if it is exactly an int
+ * int intval = result.getInt();
+ * ...
+ *
+ * // Alternatively, you can get the exact type out.
+ * XQItemType type = result.getItemType();
+ *
+ * // Now perform the comparison..
+ * if (type.equals(intType))
+ * { ... };
+ *
+ * }
+ * \endcode
+ * See also:
+ * Table 6 - XQuery Atomic Types and Corresponding Java Object Types, XQuery API for Java (XQJ) 1.0, for mapping of XQuery atomic types to Java object types. For example, if the XQuery value returned is of type xs:unsignedByte, then calling the getObject() method will return a Java object of type java.lang.Short.
+ * Table 7 - XQuery Node Types and Corresponding Java Object Types XQuery API for Java (XQJ) 1.0, for the mapping of XQuery node types to the corresponding Java object types. For example, if the XQuery value returned is an element node, then calling the getObject() or getNode() method will return a Java object of type org.w3.dom.Element.
+ *
+
+ */
class XQItem implements javax.xml.xquery.XQItem {
private Item item;
@@ -80,6 +121,12 @@
this.itemType = item.getItemType();
}
+ /** \brief Close the item and release all the resources associated with this item.
+ *
+ * No method other than the isClosed or close method may be called once the item is closed. Calling close on an XQItem object that is already closed has no effect.
+ *
+ * @throw XQException - if there is an error during closing the item
+ */
@Override
public void close() throws XQException {
if (!closed) {
@@ -89,11 +136,22 @@
}
}
+ /** \brief Checks if the item is closed.
+ *
+ * @return boolean true if the item is in a closed state, false otherwise
+ */
@Override
public boolean isClosed() {
return closed;
}
+ /** \brief Gets the current item as a boolean.
+ *
+ * The current item must be an atomic value of type xs:boolean or a subtype.
+ *
+ * @return a boolean representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a boolean fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public boolean getBoolean() throws XQException {
isClosedXQException();
@@ -109,6 +167,13 @@
return result;
}
+ /** \brief Gets the current item as a byte.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of byte.
+ *
+ * @return a byte representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a byte fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public byte getByte() throws XQException {
isClosedXQException();
@@ -126,6 +191,13 @@
return result;
}
+ /** \brief Gets the current item as a double.
+ *
+ * The current item must be an atomic value of type xs:double or a subtype.
+ *
+ * @return a double representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a double fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public double getDouble() throws XQException {
isClosedXQException();
@@ -143,6 +215,13 @@
return result;
}
+ /** \brief Gets the current item as a float.
+ *
+ * The current item must be an atomic value of type xs:float or a subtype.
+ *
+ * @return a float representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a float fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public float getFloat() throws XQException {
isClosedXQException();
@@ -160,6 +239,13 @@
return result;
}
+ /** \brief Gets the current item as an int.
+ *
+ * Gets the current item as an int. The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of int.
+ *
+ * @return an int representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a int fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public int getInt() throws XQException {
isClosedXQException();
@@ -177,12 +263,26 @@
return result;
}
+ /** \brief Gets the type of the item.
+ *
+ * On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method.
+ *
+ * @return the type of the item
+ * @throw XQException - if (1) there are errors accessing the type of the item, or (2) the underlying sequence or item is in a closed state
+ */
@Override
public XQItemType getItemType() throws XQException {
isClosedXQException();
return itemType;
}
+ /** \brief Gets the current item as a Java String.
+ *
+ * The current item must be an atomic value. This function casts the current item to an xs:string value according to the casting rules defined in 17.1.2 Casting to xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators, and then returns the value as a Java String.
+ *
+ * @return the string representation of the item
+ * @throw XQException - if (1) there are errors accessing the item's value, (2) the item is not an atomic value, (3) there is an error when casting the item to a string representation, (4) the underlying sequence or item is in a closed state, or (5) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public String getAtomicValue() throws XQException {
isClosedXQException();
@@ -202,6 +302,13 @@
return lItem.getStringValue();
}
+ /** \brief Gets the current item as a long.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of long.
+ *
+ * @return a long representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a long fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public long getLong() throws XQException {
isClosedXQException();
@@ -219,6 +326,13 @@
return result;
}
+ /** \brief Gets the item as a DOM node.
+ *
+ * The current item must be a node. The type of the returned DOM node is governed by Table 7 - XQuery Node Types and Corresponding Java Object Types XQuery API for Java (XQJ) 1.0 The instance of the returned node is implementation dependent. The node may be a reference or a copy of the internal state of the item. It is advisable to make a copy of the node if the application plans to modify it.
+ *
+ * @return a DOM node representing the current item
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public Node getNode() throws XQException {
isClosedXQException();
@@ -269,6 +383,14 @@
return result;
}
+ /** \brief Returns the URI for this item.
+ *
+ * If the item is a document node, then this method returns the absolute URI of the resource from which the document node was constructed. If the document URI is not available, then the empty string is returned. If the document URI is available, the returned value is the same as if fn:document-uri were evaluated on this document node. If the item is of a node kind other than document node, then the returned URI is implementation-defined.
+ * On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method on the current item.
+ *
+ * @return the document URI for this document node or the empty string if not available. For other node kinds, the result is implementation-defined
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state
+ */
@Override
public URI getNodeUri() throws XQException {
isClosedXQException();
@@ -301,6 +423,13 @@
return result;
}
+ /** \brief Gets the current item as an Object.
+ *
+ * The data type of the returned object will be the Java Object type as specified in 14.4 Mapping an XQuery Atomic Value to a Java Object Type and 14.5 Mapping an XQuery Node to a Java Object Type, XQuery API for Java (XQJ) 1.0.
+ *
+ * @return an object representing the current item
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) if the underlying sequence or item is in a closed state, or (3) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public Object getObject() throws XQException {
isClosedXQException();
@@ -454,6 +583,13 @@
return result;
}
+ /** \brief Read the current item as an XMLStreamReader object.
+ *
+ * Read the current item as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the underlying item or sequence. The operation on the stream is undefined if the underlying sequence is repositioned or the state of the underlying item or sequence is changed by concurrent operations.
+ *
+ * @return an XML reader object as XMLStreamReader
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the current item into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0
+ */
@Override
public XMLStreamReader getItemAsStream() throws XQException {
isClosedXQException();
@@ -467,6 +603,14 @@
return result;
}
+ /** \brief Serializes the current item according to the XSLT 2.0 and XQuery 1.0 serialization.
+ *
+ * Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @return the serialized representation of the item
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) if there are errors during serialization
+ */
@Override
public String getItemAsString(Properties prprts) throws XQException {
isClosedXQException();
@@ -486,6 +630,13 @@
return result;
}
+ /** \brief Gets the current item as a short.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of short.
+ *
+ * @return a short representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a short fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public short getShort() throws XQException {
isClosedXQException();
@@ -503,12 +654,48 @@
return result;
}
+ /** \brief Checks if the item "matches" an item type.
+ *
+ * Checks if the item "matches" an item type, as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language. You can use this method to first check the type of the result before calling the specific get methods.
+ *
+ * Example -
+ * \code{.java}
+ * ...
+ * XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ * XQItemType nodeType = conn.createNodeType();
+ *
+ * XQSequence result = preparedExpr.executeQuery();
+ * while (result.next())
+ * {
+ * // Generic check for node..
+ * if (result.instanceOf(nodeType))
+ * org.w3.dom.Node node = result.getNode();
+ * else if (result.instanceOf(strType))
+ * String str = result.getAtomicValue();
+ * }
+ *
+ *
+ * If either the type of the XQItemAccessor or the input XQItemType is not a built-in type, then this method is allowed to raise exception if it can NOT determine the instanceOf relationship due to the lack of the access of the XML schema that defines the user defined schema types if the XQMetaData.isUserDefinedXMLSchemaTypeSupported() method returns false.
+ * Otherwise, this method must determine if the type of the XQItemAccessor is an instance of the input XQItemType. Note even if isUserDefinedXMLSchemaTypeSupported() returns false, an XQJ implementation may still be able to determine the instanceOf relationship for certain cases involving user defined schema type. For example, if the type of an XQItemAccessor is of mySchema:hatSize sequence type and the input parameter XQItemType is of item() sequence type, the return value for instanceOf relationship should always be true even though the XQJ implementation does not know the precise type information of mySchema:hatSize type defined in XML schema 'mySchema'.
+ * \endcode
+ * @param xqit - item type to match
+ * @return true if this item matches the input item type as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language, and false if it does not
+ * @throw XQException - if (1) there are errors accessing the item's type, (2) if the underlying sequence or item is in a closed state, (3) if the implementation is unable to determine the schema definition of a user defined schema type, or (4) the type parameter is null
+ */
@Override
public boolean instanceOf(XQItemType xqit) throws XQException {
isClosedXQException();
return itemType.equals(xqit);
}
+ /** \brief Serializes the current item to a Writer.
+ *
+ * Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * @param out - the output stream into which the current item is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null
+ */
@Override
public void writeItem(OutputStream out, Properties prprts) throws XQException {
isClosedXQException();
@@ -528,6 +715,15 @@
}
}
+ /** \brief Serializes the current item to a Writer.
+ *
+ * Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
+ * @param out - the output stream into which the current item is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null
+ */
@Override
public void writeItem(Writer writer, Properties prprts) throws XQException {
isClosedXQException();
@@ -547,6 +743,13 @@
}
}
+ /** \brief Writes the current item to a SAX handler.
+ *
+ * Writes the current item to a SAX handler, as described in in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
+ *
+ * @param saxhdlr - the SAX content handler, optionally a lexical handler
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null
+ */
@Override
public void writeItemToSAX(ContentHandler ch) throws XQException {
isClosedXQException();
@@ -582,6 +785,17 @@
}
}
+ /** \brief Writes the current item to a Result.
+ *
+ * First the item is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object.
+ * Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMResult
+ * - javax.xml.transform.sax.SAXResult
+ * - javax.xml.transform.stream.StreamResult
+ *
+ * @param result - the result object into which the item is to be serialized
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the current item into the Result object, or (5) the result parameter is null
+ */
@Override
public void writeItemToResult(Result result) throws XQException {
isClosedXQException();
=== modified file 'swig/xqj/XQItemType.java'
--- swig/xqj/XQItemType.java 2012-04-19 23:07:13 +0000
+++ swig/xqj/XQItemType.java 2012-05-14 18:27:25 +0000
@@ -22,7 +22,19 @@
import org.zorbaxquery.api.IdentTypes.Kind;
import org.zorbaxquery.api.Item;
import org.zorbaxquery.api.TypeIdentifier;
-
+/**
+ * The XQItemType class represents an item type as defined in XQuery 1.0: An XML Query language.
+ * The XQItemType extends the XQSequenceType but restricts the occurrance indicator to be exactly one. This derivation allows passing an item type wherever a sequence type is expected, but not the other way. The XQItemType interface contains methods to represent information about the following aspects of an item type:
+ *
+ * - The kind of the item - one of XQITEMKIND_* constants
+ * - The base type of the item - one of the XQBASETYPE_* constants. For atomic types this is the closest matching built-in XML Schema type, for element and attributes the closest matching built-in XML Schema type this node is based on.
+ * - Name of the node, if any
+ * - Type name, if any. If present, then also whether the typename is an anonymous type
+ * - XML Schema URI associated with the type, if any
+ * - The nillability characteristics, if any
+ *
+ * An instance of the XQItemType is a standalone object that is independant of the XQConnection and any XQuery static or dynamic context.
+ */
public class XQItemType implements javax.xml.xquery.XQItemType {
public static final int ZORBA_XQITEMKIND_ANY = 0;
public static final int ZORBA_XQITEMKIND_DOCUMENT = 1;
@@ -396,7 +408,7 @@
generateTypeName();
}
-
+
private void generateTypeName() {
String namespaceURI = "http://www.w3.org/2001/XMLSchema";
String localPart = "untyped";
@@ -562,10 +574,16 @@
}
typeName = new QName(namespaceURI, localPart, prefix);
}
-
-
-
-
+
+ /** \brief Returns the base type of the item.
+ *
+ * One of the XQBASETYPE_* constants.
+ *
+ * XQJ defines a constant for each of the built-in schema types defined in XML Schema. For atomic types this is the closest matching built-in XML Schema type, for element and attributes the closest matching built-in XML Schema type this node is based on.
+ *
+ * @return int one of the XQBASETYPE_* constants indicating the basic type of the item
+ * @throw XQException - if the item kind is not one of: XQITEMKIND_DOCUMENT_ELEMENT, XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT, XQITEMKIND_ELEMENT, XQITEMKIND_SCHEMA_ELEMENT, XQITEMKIND_ATTRIBUTE, XQITEMKIND_SCHEMA_ATTRIBUTE, or XQITEMKIND_ATOMIC
+ */
@Override
public int getBaseType() throws XQException {
if (!((itemKind==XQItemType.XQITEMKIND_DOCUMENT_ELEMENT) ||
@@ -580,16 +598,35 @@
return baseType;
}
+ /** \brief Returns the kind of the item.
+ *
+ * One of the XQITEMKIND_* constants.
+ *
+ * @return int one of the XQITEMKIND_* constants indicating the basic kind of the item
+ */
@Override
public int getItemKind() {
return itemKind;
}
+ /** \brief Returns the occurrence indicator for the item type.
+ *
+ * This method will always return the value XQSequenceType.OCC_EXACTLY_ONE.
+ *
+ * @return int indicating the occurrence indicator
+ */
@Override
public int getItemOccurrence() {
return XQSequenceType.OCC_EXACTLY_ONE;
}
+ /** \brief Returns the name of the node.
+ *
+ * Returns the name of the node in case the item kind is an XQITEMKIND_DOCUMENT_ELEMENT, XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT, XQITEMKIND_ELEMENT, XQITEMKIND_SCHEMA_ELEMENT, XQITEMKIND_ATTRIBUTE, or XQITEMKIND_SCHEMA_ATTRIBUTE. For example, in the case of a type for element "foo" this will return the QName foo. For wildcard entries a null value will be returned.
+ *
+ * @return QName for the name of the element, attribute, or document element node. null if it is a wildcard
+ * @throw XQException - if the item kind is not one of: XQITEMKIND_DOCUMENT_ELEMENT, XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT, XQITEMKIND_ELEMENT, XQITEMKIND_SCHEMA_ELEMENT, XQITEMKIND_ATTRIBUTE, or XQITEMKIND_SCHEMA_ATTRIBUTE
+ */
@Override
public QName getNodeName() throws XQException {
if (!((itemKind==XQItemType.XQITEMKIND_DOCUMENT_ELEMENT) ||
@@ -603,11 +640,24 @@
return nodeName;
}
+ /** \brief Returns the schema location URI of the schema that contains the item's element or type definition.
+ *
+ * This method is implementation-definied and an implementation will return a null value if it does not support retrieving the schema location URI. If the item corresponds to a validated global element in a schema, the result will be the schema location URI to the XMLSchema containing the element definition. Otherwise if the item is a schema validated node, the result will be the schema location URI of the XMLSchema containing the type definition of that node. If the item is not schema validated, the result is null.
+ *
+ * @return URI representing the schema location URI of the XMLSchema containing the global element definition or the type definition of the current item. null in case the item is not schema validated or if the implementation does not support retrieving the schema URI.
+ */
@Override
public URI getSchemaURI() {
return schemaURI;
}
+ /** \brief Represents a type name (global or local).
+ *
+ * This can be used to represent specific type name such as, element foo of type hatsize. The schema type name is represented as a single QName. If the return type is an anonymous type, the actual QName value returned is implementation defined.
+ *
+ * @return the QName of the schema type in case of a user defined or anonoymous types. For a built-in type, returns a predefined type name as QName (e.g.xs:anyType, xs:decimal, etc). Cannot be null.
+ * @throw XQException - if the item kind is not one of: XQITEMKIND_DOCUMENT_ELEMENT, XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT, XQITEMKIND_ATOMIC, XQITEMKIND_ELEMENT, XQITEMKIND_SCHEMA_ELEMENT, XQITEMKIND_ATTRIBUTE, or XQITEMKIND_SCHEMA_ATTRIBUTE
+ */
@Override
public QName getTypeName() throws XQException {
if (!((itemKind==XQItemType.XQITEMKIND_DOCUMENT_ELEMENT) ||
@@ -622,16 +672,31 @@
return typeName;
}
+ /** \brief Represents whether the item type is an anonymous type in the schema.
+ *
+ * @return true if the item type is an anonymous type in the schema, false otherwise.
+ */
@Override
public boolean isAnonymousType() {
return (itemKind==0);
}
+ /** \brief Returns whether the element type is nillable or not.
+ *
+ * @return true if the element type is nillable, false otherwise.
+ */
@Override
public boolean isElementNillable() {
return allowNill;
}
+ /** \brief Returns the name of the processing instruction type.
+ *
+ * As such the item kind of this XQItemType must be XQITEMKIND_PI.
+ *
+ * @return the name of the processing instruction type. null if it is a wildcard.
+ * @throw XQException - if the item kind is not XQITEMKIND_PI
+ */
@Override
public String getPIName() throws XQException {
if (itemKind!=XQItemType.XQITEMKIND_PI) {
@@ -640,11 +705,32 @@
return piTarget;
}
+ /** \brief Returns the type of the item in the sequence type.
+ *
+ * @return XQItemType representing the item type in the sequence. null is returned in case of an empty sequence.
+ */
@Override
public XQItemType getItemType() {
return this;
}
-
+
+ /** \brief Compares the specified object with this item type for equality.
+ *
+ * The result is true only if the argument is an item type object which represents the same XQuery item type.
+ *
+ * In order to comply with the general contract of equals and hashCode across different implementations the following algorithm must be used. Return true if and only if both objects are XQItemType and:
+ * - getItemKind() is equal
+ * - if getBaseType() is supported for the item kind, it must be equal
+ * - if getNodeName() is supported for the item kind, it must be equal
+ * - getSchemaURI() is equal
+ * - if getTypeName() is supported for the item kind, it must be equal
+ * - isAnonymousType() is equal
+ * - isElementNillable() is equal
+ * - if getPIName() is supported for the item kind, it must be equal
+ *
+ * @param o - an XQItemType object representing an XQuery item type
+ * @return true if the input item type object represents the same XQuery item type, false otherwise
+ */
@Override
public boolean equals(Object o) {
boolean result = false;
@@ -685,6 +771,27 @@
return result;
}
+ /** \brief Returns a hash code consistent with the definition of the equals method.
+ *
+ * In order to comply with the general contract of equals and hashCode across different implementations the following algorithm must be used:
+ * \code{.java}
+ * hashCode = this.getItemKind();
+ * if this.getSchemaURI != null
+ * hashCode = 31*hashCode + this.getSchemaURI().hashCode();
+ * if this.getBaseType() is supported for the item kind
+ * hashCode = 31*hashCode + this.getbaseType();
+ * if this.getNodeName () is supported for the item kind and
+ * this.getNodeName() != null
+ * hashCode = 31*hashCode + this.getNodeName().hashCode()
+ * if this.getTypeName () is supported for the item kind
+ * hashCode = 31*hashCode + this.getTypeName().hashCode();
+ * if this.getPIName () is supported for the item kind and
+ * this.getPIName () != null
+ * hashCode = 31*hashCode + this.getPIName().hashCode();
+ * \endcode
+ *
+ * @return hash code for this item type
+ */
@Override
public int hashCode() {
int hashCode = 0;
@@ -715,6 +822,10 @@
return hashCode;
}
+ /** \brief Returns a human-readable implementation-defined string representation of the item type.
+ *
+ * @return String a string representation of the item type
+ */
@Override
public String toString() {
StringBuffer result = new StringBuffer();
=== modified file 'swig/xqj/XQMetaData.java'
--- swig/xqj/XQMetaData.java 2012-04-19 23:07:13 +0000
+++ swig/xqj/XQMetaData.java 2012-05-14 18:27:25 +0000
@@ -21,6 +21,18 @@
import javax.xml.xquery.XQException;
import org.zorbaxquery.api.Zorba;
+ /**
+ * XQMetaData class provides information about the data source, in various aspects, such as the product name and version identification, supported features, specific behaviors, user information, product limits and so forth.
+ *
+ * An object from this class is obtained from the connection object by calling the getMetaData() method, for example:
+ * \code{.java}
+ * XQMetaData metaData = connection.getMetaData();
+ * String productVersion = metaData.getProductVersion();
+ * ...
+ * \endcode
+ *
+ * Since the metadata object depends on the connection, all its methods would raise an exception if the connection it is created from is no longer valid.
+ */
public class XQMetaData implements javax.xml.xquery.XQMetaData {
private int XQJ_MAJOR = 1;
@@ -35,139 +47,256 @@
connection = conn;
zorba = ((org.zorbaxquery.api.xqj.XQConnection)connection).getZorbaInstance();
}
-
+
+ /** \brief Gets the major version of this product.
+ *
+ * @return a integer indicating the major version of this product
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public int getProductMajorVersion() throws XQException {
isClosedXQException();
return zorba.getMajorVersion();
}
+ /** \brief Gets the minor version of this product.
+ *
+ * @return a integer indicating the minor version of this product
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public int getProductMinorVersion() throws XQException {
isClosedXQException();
return zorba.getMinorVersion();
}
+ /** \brief Gets the name of this product.
+ *
+ * @return a string indicating the product name
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public String getProductName() throws XQException {
isClosedXQException();
return "Zorba - The XQuery Processor";
}
+ /** \brief Gets the full version of this product.
+ *
+ * @return a string indicating the product version
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public String getProductVersion() throws XQException {
isClosedXQException();
return zorba.getVersion();
}
+ /** \brief Gets the major version number of XQJ specification supported by this implementation.
+ *
+ * @return an integer indicating the XQJ major version
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public int getXQJMajorVersion() throws XQException {
isClosedXQException();
return XQJ_MAJOR;
}
+ /** \brief Gets the minor version number of XQJ specification supported by this implementation.
+ *
+ * @return an integer indicating the XQJ minor version
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public int getXQJMinorVersion() throws XQException {
isClosedXQException();
return XQJ_MINOR;
}
+ /** \brief Gets the full version of XQJ specification supported by this implementation.
+ *
+ * @return a string indicating the version of XQJ specification
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public String getXQJVersion() throws XQException {
isClosedXQException();
return new String().concat(new Integer(XQJ_MAJOR).toString()).concat(".").concat(new Integer(XQJ_MINOR).toString());
}
+ /** \brief Query if the associated conection is restricted for read only use.
+ *
+ * @return true if the associated connection is for read-only; false otherwise
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isReadOnly() throws XQException {
isClosedXQException();
return false;
}
+ /** \brief Query if XQueryX format is supported in this data source.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isXQueryXSupported() throws XQException {
isClosedXQException();
return zorba.isXQueryXSupported();
}
+ /** \brief Query if transaction is supported in this data source.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isTransactionSupported() throws XQException {
isClosedXQException();
return false;
}
+ /** \brief Query if XQuery static typing feature is supported in this data source.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isStaticTypingFeatureSupported() throws XQException {
isClosedXQException();
return false;
}
+ /** \brief Query if XQuery schema import feature is supported in this connection.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isSchemaImportFeatureSupported() throws XQException {
isClosedXQException();
return true;
}
+ /** \brief Query if XQuery schema validation feature is supported in this connection.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isSchemaValidationFeatureSupported() throws XQException {
isClosedXQException();
return true;
}
+ /** \brief Query if XQuery full axis feature is supported in this connection.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isFullAxisFeatureSupported() throws XQException {
isClosedXQException();
return true;
}
+ /** \brief Query if XQuery module feature is supported in this connection.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isModuleFeatureSupported() throws XQException {
isClosedXQException();
return true;
}
+ /** \brief Query if XQuery serialization feature is supported in this connection.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isSerializationFeatureSupported() throws XQException {
isClosedXQException();
return true;
}
+ /** \brief Query if XQuery static typing extensions are supported in this connection.
+ *
+ * @return true if so; otherwise false
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isStaticTypingExtensionsSupported() throws XQException {
isClosedXQException();
return false;
}
+ /** \brief Gets the user name associated with this connection.
+ *
+ * @return the user's name
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public String getUserName() throws XQException {
isClosedXQException();
return null;
}
+ /** \brief Gets the maximum number of characters allowed in an expression in this data source.
+ *
+ * @return the maximum length of expression as an integer. A zero value means that there is no limit or the limit is unknown.
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public int getMaxExpressionLength() throws XQException {
isClosedXQException();
return 0;
}
+ /** \brief Gets the maximum number of characters allowed in a user name.
+ *
+ * @return the maximum length of user name as an integer. A zero value means that there is no limit or the limit is unknown.
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public int getMaxUserNameLength() throws XQException {
isClosedXQException();
return 0;
}
+ /** \brief Query if this connection was created from a JDBC connection.
+ *
+ * @return true, if this connection was created from a JDBC connection, false otherwise.
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean wasCreatedFromJDBCConnection() throws XQException {
isClosedXQException();
return false;
}
+ /** \brief Query if the XQuery encoding declaration is supported by the XQJ implementation.
+ *
+ * @return true if the XQuery encoding declaration is supported; false otherwise
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isXQueryEncodingDeclSupported() throws XQException {
isClosedXQException();
return false;
}
+ /** \brief Returns a set of java.lang.String, each of which specifies a character encoding method the XQJ implmentation supports to parse the XQuery query text.
+ *
+ * For an example, for an XQJ impmentation which is able to parse the XQuery encoded in "UTF-8" or "UTF-16", it returns a java.util.Set of "UTF-8" and "UTF-16". If the implemetation is not able to generate a list of encodings supported, an empty set is returned. If a non-empty set is returned, the encodings returned in this set are guaranteed to be supported. Note that encodings not in the returned set might also be supported. For example, if the set has two encoding methods: 'UTF-8' and 'UTF-16', they are supported by the implementation. However, this does not mean 'Shift-Js' is not supported. It might be supported.
+ *
+ * @return a java.util.Set of java.lang.String, each of which is an XQuery query text encoding method
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public Set getSupportedXQueryEncodings() throws XQException {
isClosedXQException();
@@ -177,6 +306,12 @@
}
+ /** \brief Query if a character encoding method of the XQuery query text is supported by the XQJ implmentation.
+ *
+ * @param encoding - String representing the character encoding method of the XQuery query text.
+ * @return true if an XQuery query character encoding method is supported, false otherwise
+ * @throw XQException - if (1) the connection is no longer valid, or (2) the specified encoding parameter is null
+ */
@Override
public boolean isXQueryEncodingSupported(String string) throws XQException {
isClosedXQException();
@@ -184,6 +319,13 @@
return string.equals("UTF8");
}
+ /** \brief Check if the user defined XML schema type is supported in this connection.
+ *
+ * If this method returns true, then XQItemAccessor.instanceOf(XQItemType) must be able to determine if the type of an XQItemAccessor is an instance of the XQItemType even if either of them is a user defined XML schema type which is defined by the non-predefined XML schema. The pre-defined XML Schema refers to the XML schema whose schema URL is "http://www.w3.org/2001/XMLSchema"
+ *
+ * @return true if the user defined XML schema type is supported in this connection, false otherwise.
+ * @throw XQException - if the connection is no longer valid
+ */
@Override
public boolean isUserDefinedXMLSchemaTypeSupported() throws XQException {
isClosedXQException();
=== modified file 'swig/xqj/XQPreparedExpression.java'
--- swig/xqj/XQPreparedExpression.java 2012-05-03 12:31:51 +0000
+++ swig/xqj/XQPreparedExpression.java 2012-05-14 18:27:25 +0000
@@ -53,7 +53,53 @@
import org.zorbaxquery.api.Item;
import org.zorbaxquery.api.Iterator;
import org.zorbaxquery.api.XmlDataManager;
-
+ /**
+ * This class describes an expression that can be prepared for multiple subsequent executions. A prepared expression can be created from the connection.
+ *
+ * The preparation of the expression does the static analysis of the expression using the static context information.
+ *
+ * The dynamic context information, such as values for bind variables, can then be set using the setter methods. When setting values for bind variables, these variables should be present as external variables in the prolog of the prepared expression.
+ *
+ * The static type information of the query can also be retrieved if the XQuery implementation provides it using the getStaticResultType method.
+ *
+ * When the expression is executed using the executeQuery method, if the execution is successful, then an XQResultSequence object is returned. The XQResultSequence object is tied to the XQPreparedExpression from which it was prepared and is closed implicitly if that expression is either closed or if re-executed.
+ *
+ * The XQPreparedExpression object is dependent on the XQConnection object from which it was created and is only valid for the duration of that object. Thus, if the XQConnection object is closed then this XQPreparedExpression object will be implicitly closed and it can no longer be used.
+ *
+ * An XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call close method explicitly to free any resources. It is also recommended that they do so under a final block to ensure that the object is closed even when there are exceptions. Not closing this object implicitly or explicitly might result in serious memory leaks.
+ *
+ * When the XQPreparedExpression is closed any XQResultSequence object obtained from it is also implicitly closed.
+ *
+ * Example -
+ * \code{.java}
+ * XQConnection conn = XQDataSource.getconnection();
+ * XQPreparedExpression expr = conn.prepareExpression
+ * ("for $i in (1) return 'abc' ");
+ *
+ * // get the sequence type out.. This would be something like xs:string *
+ * XQSequenceType type = expr.getStaticResultType();
+ *
+ * XQSequence result1 = expr.executeQuery();
+ *
+ * // process the result..
+ * result1.next();
+ * System.out.println(" First result1 "+ result1.getAtomicValue());
+ *
+ * XQResultSequence result2 = expr.executeQuery();
+ *
+ * // result1 is implicitly closed
+ * // recommended to close the result sequences explicitly.
+ *
+ * // process the result..
+ * while (result2.next())
+ * System.out.println(" result is "+ result2.getAtomicValue());
+ *
+ * result2.close();
+ * expr.close(); // closing expression implicitly closes all result sequence or
+ * // items obtained from this expression.
+ * conn.close(); // closing connections will close expressions and results.
+ * \endcode
+ */
public class XQPreparedExpression implements javax.xml.xquery.XQPreparedExpression {
private XQuery query;
@@ -99,17 +145,32 @@
}
}
+ /** \brief Attempts to cancel the execution if both the XQuery engine and XQJ driver support aborting the execution of an XQPreparedExpression.
+ *
+ * This method can be used by one thread to cancel an XQPreparedExpression, that is being executed in another thread. If cancellation is not supported or the attempt to cancel the execution was not successful, the method returns without any error. If the cancellation is successful, an XQException is thrown, to indicate that it has been aborted, by executeQuery, executeCommand or any method accessing the XQResultSequence returned by executeQuery. If applicable, any open XQResultSequence and XQResultItem objects will also be implicitly closed in this case.
+ *
+ * @throw XQException - if the prepared expression is in a closed state
+ */
@Override
public void cancel() throws XQException {
isClosedXQException();
-
}
+ /** \brief Checks if the prepared expression in a closed state.
+ *
+ * @return true if the prepared expression is in a closed state, false otherwise.
+ */
@Override
public boolean isClosed() {
return closed;
}
+ /** \brief Closes the expression object and release all resources associated with this prepared expression.
+ *
+ * This also closes any result sequences obtained from this expression. Once the expression is closed, all methods on this object other than the close or isClosed will raise exceptions. Calling close on an XQExpression object that is already closed has no effect.
+ *
+ * @throw XQException - if there are errors when closing the expression
+ */
@Override
public void close() throws XQException {
closed = true;
@@ -121,6 +182,13 @@
}
}
+ /** \brief Executes the prepared query expression.
+ *
+ * Calling this method implicitly closes any previous result sequence obtained from this expression.
+ *
+ * @return the xquery sequence object containing the result of the query execution
+ * @throw XQException - if (1) there are errors when executing the prepared expression, (2) the prepared expression is in a closed state, or (3) the query execution is cancelled
+ */
@Override
public XQResultSequence executeQuery() throws XQException {
isClosedXQException();
@@ -134,6 +202,11 @@
return result;
}
+ /** \brief Retrieves all the external variables defined in the prolog of the prepared expression.
+ *
+ * @return an array of QName objects for all the external variables defined in the prolog of a prepared expression. Empty array if there are no external variables present.
+ * @throw XQException - if the prepared expression is in a closed state
+ */
@Override
public QName[] getAllExternalVariables() throws XQException {
isClosedXQException();
@@ -150,7 +223,6 @@
return result.toArray(new QName[0]);
}
-
private boolean isExternal(String varName) {
boolean found=false;
Iterator iter = new Iterator();
@@ -166,7 +238,14 @@
iter.delete();
return found;
}
-
+
+ /** \brief Retrieves the names of all unbound external variables.
+ *
+ * Gets the static type information of the result sequence. If an implementation does not do static typing of the query, then this method must return an XQSequenceType object corresponding to the XQuery sequence type item()*.
+ *
+ * @return XQSequenceType containing the static result information.
+ * @throw XQException - if the prepared expression is in a closed state
+ */
@Override
public QName[] getAllUnboundExternalVariables() throws XQException {
isClosedXQException();
@@ -192,6 +271,13 @@
return result.toArray(new QName[0]);
}
+ /** \brief Gets the static type information of the result sequence.
+ *
+ * If an implementation does not do static typing of the query, then this method must return an XQSequenceType object corresponding to the XQuery sequence type item()*.
+ *
+ * @return XQSequenceType containing the static result information.
+ * @throw XQException - if the prepared expression is in a closed state
+ */
@Override
public XQSequenceType getStaticResultType() throws XQException {
isClosedXQException();
@@ -199,6 +285,12 @@
return result;
}
+ /** \brief Retrieves the static type of a given external variable.
+ *
+ * @param varName - the name of the external variable
+ * @return the static type information of the variable as defined in the prolog of the prepared expression
+ * @throw XQException - if (1) the variable does not exist in the static context of the expression, or (2) the sequence is in a closed state, or (3) the name parameter is null
+ */
@Override
public XQSequenceType getStaticVariableType(QName varName) throws XQException {
isClosedXQException();
@@ -228,6 +320,13 @@
return result;
}
+ /** \brief Gets an XQStaticContext representing the values for all expression properties.
+ *
+ * Note that these properties cannot be changed; in order to change, a new XQPreparedExpression needs to be created.
+ *
+ * @return an XQStaticContext representing the values for all expression properties
+ * @throw XQException - if the expression is in a closed state
+ */
@Override
public XQStaticContext getStaticContext() throws XQException {
isClosedXQException();
@@ -237,6 +336,11 @@
return staticContext;
}
+ /** \brief Gets the implicit timezone
+ *
+ * @return the implicit timezone. This may have been set by an application using the setImplicitTimeZone method or provided by the implementation
+ * @throw XQException - if the expression is in a closed state
+ */
@Override
public TimeZone getImplicitTimeZone() throws XQException {
isClosedXQException();
@@ -245,6 +349,15 @@
return result;
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the casting from xs:string rules outlined in 17.1.1 Casting from xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators. If the cast fails, or if there is a mismatch between the static and dynamic types, an XQException is thrown either by this method or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to
+ * @param value - the lexical string value of the type
+ * @param type - the item type of the bind
+ * @throw XQException - if (1) any of the arguments are null, (2) given type is not an atomic type, (3) the conversion of the value to an XDM instance failed, (4) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (5) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (6) the expression is in a closed state
+ */
@Override
public void bindAtomicValue(QName varName, String value, XQItemType type) throws XQException {
isClosedXQException();
@@ -268,6 +381,16 @@
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type, which must represent an xs:string or a type derived by restriction from xs:string. If the specified type is null, it defaults to xs:string.
+ * Subsequently the value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0,. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type, xs:string, is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindString(QName varName, String value, XQItemType type) throws XQException {
isClosedXQException();
@@ -306,6 +429,20 @@
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, String value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -335,6 +472,20 @@
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, Reader value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -367,6 +518,20 @@
bindDocument(varName, writer.toString(), baseURI, type);
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, InputStream value, String baseURI, XQItemType type) throws XQException {
isClosedXQException();
@@ -393,6 +558,20 @@
bindDocument(varName, out.toString(), baseURI, type);
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, XMLStreamReader value, XQItemType type) throws XQException {
isClosedXQException();
@@ -438,6 +617,25 @@
return sw.toString();
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * Binds a value to the given external variable or the context item from the given Source. An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMSource
+ * - javax.xml.transform.sax.SAXSource
+ * - javax.xml.transform.stream.StreamSource
+ *
+ * If the value represents a well-formed XML document, it will be parsed and results in a document node. The kind of the input type must be null, XQITEMKIND_DOCUMENT_ELEMENT, or XQITEMKIND_DOCUMENT_SCHEMA_ELEMENT.
+ *
+ * The value is converted into an instance of the specified type according to the rules defined in 14.3 Mapping a Java XML document to an XQuery document node, XQuery API for Java (XQJ) 1.0.
+ *
+ * If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation. If the value is not well formed, or if a kind of the input type other than the values list above is specified, behavior is implementation defined and may raise an exception.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be converted, cannot be null
+ * @param baseURI - an optional base URI, can be null. It can be used, for example, to resolve relative URIs and to include in error messages.
+ * @param type - the type of the value for the created document node. If null is specified, it behaves as if XQDataFactory.createDocumentElementType( XQDataFactory.createElementType(null, XQItemType.XQBASETYPE_XS_UNTYPED)) were passed in as the type parameter. That is, the type represents the XQuery sequence type document-node(element(*, xs:untyped))
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDocument(QName varName, Source value, XQItemType type) throws XQException {
isClosedXQException();
@@ -463,6 +661,11 @@
}
}
+ /** \brief Sets the implicit timezone
+ *
+ * @param implicitTimeZone - time zone to be set
+ * @throw XQException - if the expression is in a closed state
+ */
@Override
public void setImplicitTimeZone(TimeZone value) throws XQException {
isClosedXQException();
@@ -474,6 +677,14 @@
}
}
+ /** \brief Binds a value to the given external variable.
+ *
+ * The dynamic type of the value is derived from the XQItem. In case of a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @throw XQException - if (1) any of the arguments are null, (2) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (3) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, (4) the expression is in a closed state, or (5) the specified item is closed
+ */
@Override
public void bindItem(QName varName, XQItem value) throws XQException {
isClosedXQException();
@@ -490,6 +701,14 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The input sequence is consumed from its current position to the end, after which the input sequence's position will be set to point after the last item. The dynamic type of the value is derived from the items in the sequence. In case of a mismatch between the static and dynamic types, an XQException is be raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @throw XQException - if (1) any of the arguments are null, (2) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (3) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, (4) the expression is in a closed state, or (5) the specified item is closed
+ */
@Override
public void bindSequence(QName varName, XQSequence value) throws XQException {
isClosedXQException();
@@ -515,6 +734,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindObject(QName varName, Object value, XQItemType type) throws XQException {
isClosedXQException();
@@ -532,6 +760,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindBoolean(QName varName, boolean value, XQItemType type) throws XQException {
isClosedXQException();
@@ -548,6 +785,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindByte(QName varName, byte value, XQItemType type) throws XQException {
isClosedXQException();
@@ -564,6 +810,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindDouble(QName varName, double value, XQItemType type) throws XQException {
isClosedXQException();
@@ -580,6 +835,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindFloat(QName varName, float value, XQItemType type) throws XQException {
isClosedXQException();
@@ -596,6 +860,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindInt(QName varName, int value, XQItemType type) throws XQException {
isClosedXQException();
@@ -612,6 +885,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindLong(QName varName, long value, XQItemType type) throws XQException {
isClosedXQException();
@@ -628,6 +910,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindNode(QName varName, Node value, XQItemType type) throws XQException {
isClosedXQException();
@@ -645,6 +936,15 @@
}
}
+ /** \brief Binds a value to the given external variable or the context item.
+ *
+ * The value is converted into an instance of the specified type according to the rule defined in 14.2 Mapping a Java Data Type to an XQuery Data Type, XQuery API for Java (XQJ) 1.0. If the conversion fails, or if there is a mismatch between the static and dynamic types, an XQException is raised either by this method, or during query evaluation.
+ *
+ * @param varName - the name of the external variable to bind to, cannot be null
+ * @param value - the value to be bound, cannot be null
+ * @param type - the type of the value to be bound to the external variable. The default type of the value is used in case null is specified
+ * @throw XQException - if (1) the varName or value argument is null, (2) the conversion of the value to an XDM instance failed, (3) in case of an XQPreparedExpression, the dynamic type of the bound value is not compatible with the static type of the variable, (4) in case of an XQPreparedExpression, the variable is not defined in the prolog of the expression, or (5) if the expression is in a closed state
+ */
@Override
public void bindShort(QName varName, short value, XQItemType type) throws XQException {
isClosedXQException();
=== modified file 'swig/xqj/XQResultItem.java'
--- swig/xqj/XQResultItem.java 2012-04-19 23:07:13 +0000
+++ swig/xqj/XQResultItem.java 2012-05-14 18:27:25 +0000
@@ -18,7 +18,38 @@
import javax.xml.xquery.XQConnection;
import javax.xml.xquery.XQException;
import org.zorbaxquery.api.Item;
-
+ /**
+ * This class represents an immutable item object obtained from an XQResultSequence using the getItem method.
+ *
+ * A forward only result sequence does not support calling the getter methods multiple times on the same item. To work around this case, the getItem method can be used to obtain a result item and then getter methods may be called multiple times on this item.
+ *
+ * The XQResultItem object is dependent on the connection, expression and the sequence from which it was created and is only valid for the duration of those objects. Thus, if any one of those objects is closed, this XQResultItem object will be implicitly closed, and it can no longer be used. Similarly re-executing the expression also implicitly closes the associated result sequences, which in turn implicitly closes this result item.
+ *
+ * An XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call close method explicitly to free any resources. It is also recommended that they do so under a final block to ensure that the object is closed even when there are exceptions. Not closing this object implicitly or explicitly might result in serious memory leaks.
+ *
+ * Example -
+ * \code{.java}
+ *
+ * XQPreparedExpression expr = conn.prepareExpression("for $i ..");
+ * XQResultSequence result = expr.executeQuery();
+ *
+ * // posititioned before the first item
+ * while (result.next())
+ * {
+ * XQResultItem item = result.getItem();
+ * // perform multiple gets on this item
+ * // get DOM
+ * org.w3.dom.Node node = item.getNode();
+ * // get SAX
+ * item.writeItemToSAX(saxHandler);
+ *
+ * item.close(); // good practice. Item will get implicitly closed
+ * // when the expression, connection or sequence is closed.
+ * }
+ *
+ * result.close(); // explicitly close the result sequence
+ * \endcode
+ **/
public class XQResultItem extends XQItem implements javax.xml.xquery.XQResultItem {
private XQConnection connection;
@@ -29,6 +60,11 @@
connection = conn;
}
+ /** \brief Gets the XQuery connection associated with this result item
+ *
+ * @return the connection associated with this result item
+ * @throw XQException - if the result item is in a closed state
+ */
@Override
public XQConnection getConnection() throws XQException {
if (super.isClosed()) {
=== modified file 'swig/xqj/XQResultSequence.java'
--- swig/xqj/XQResultSequence.java 2012-05-03 12:31:51 +0000
+++ swig/xqj/XQResultSequence.java 2012-05-14 18:27:25 +0000
@@ -36,6 +36,43 @@
import org.zorbaxquery.api.Item;
import org.zorbaxquery.api.Iterator;
+ /**
+ * This class represents a sequence of items obtained as a result of evaluation XQuery expressions. The result sequence is tied to the XQconnection object on which the expression was evaluated.
+ *
+ * This sequence can be obtained by performing an executeQuery on the expression object. It represents a cursor-like class.
+ *
+ * The XQResultSequence object is dependent on the connection and the expression from which it was created and is only valid for the duration of those objects. Thus, if any one of those objects is closed, this XQResultSequence object will be implicitly closed and it can no longer be used. Similarly re-executing the expression also implicitly closes the associated result sequences.
+ *
+ * An XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call close method explicitly to free any resources. It is also recommended that they do so under a final block to ensure that the object is closed even when there are exceptions. Not closing this object implicitly or explicitly might result in serious memory leaks.
+ *
+ * When the XQResultSequence is closed any XQResultItem objects obtained from it are also implicitly closed.
+ *
+ * Example -
+ *
+ * \code{.java}
+ * XQPreparedExpression expr = conn.prepareExpression("for $i ..");
+ * XQResultSequence result = expr.executeQuery();
+ *
+ * // create the ItemTypes for string and integer
+ * XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ * XQItemType intType = conn.createAtomicType(XQItemType.XQBASETYPE_INT);
+ *
+ * // posititioned before the first item
+ * while (result.next())
+ * {
+ * XQItemType type = result.getItemType();
+ *
+ * // If string, then get the string value out
+ * if (type.equals(strType))
+ * String str = result.getAtomicValue();
+ * else if (type.equals(intType)) // if it is an integer..
+ * int intval = result.getInt();
+ * ...
+ * }
+ *
+ * result.close(); // explicitly close the result sequence
+ * \endcode
+ */
public class XQResultSequence implements javax.xml.xquery.XQResultSequence {
private boolean closed = false;
@@ -59,31 +96,67 @@
connection = conn;
preparedExpression = prepared;
}
-
+
+ /** \brief Gets the XQuery connection associated with this result sequence
+ *
+ * @return the connection associated with this result sequence
+ * @throw XQException - if the result sequence is in a closed state
+ */
@Override
public XQConnection getConnection() throws XQException {
isClosedXQException();
return connection;
}
+ /** \brief Moves the XQSequence's position to the given item number in this object.
+ *
+ * If the item number is positive, the XQSequence moves to the given item number with respect to the beginning of the XQSequence.
+ * The first item is item 1, the second is item 2, and so on.
+ *
+ * If the given item number is negative, the XQSequence positions itself on an absolute item position with respect to the end of the sequence.
+ *
+ * For example, calling the method absolute(-1) positions the XQSequence on the last item; calling the method absolute(-2) moves the XQSequence to the next-to-last item, and so on. absolute(0) will position the sequence before the first item.
+ *
+ * An attempt to position the sequence beyond the first/last item set leaves the current position to be before the first item or after the last item.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @param i - the item position to jump to
+ * @return true if the current position is within the sequence, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean absolute(int i) throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Move to the position after the last item.
+ *
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public void afterLast() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Moves to the position before the first item.
+ *
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public void beforeFirst() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Closes the sequence and frees all resources associated with this sequence.
+ *
+ * Closing an XQSequence object also implicitly closes all XQItem objects obtained from it. All methods other than the isClosed or close method will raise exceptions when invoked after closing the sequence. Calling close on an XQSequence object that is already closed has no effect.
+ *
+ * @throw XQException - if there are errors during closing of the sequence
+ */
@Override
public void close() throws XQException {
if (!closed) {
@@ -107,41 +180,86 @@
}
}
+ /** \brief Checks if the sequence is closed.
+ *
+ * @return true if the sequence is in a closed state, false otherwise
+ */
@Override
public boolean isClosed() {
return closed;
}
+ /** \brief Returns a number indicating the number of items in the sequence.
+ *
+ * @return the number of items in this sequence
+ * @throw XQException - if (1) the sequence is forward-only, or (2) the sequence is closed
+ */
@Override
public int count() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Gets the current cursor position.
+ *
+ * 0 indicates that the position is before the first item and count() + 1 indicates position after the last item. A specific position indicates that the cursor is positioned on the item at that position. Use the isOnItem method to verify if the cursor is positioned on the item.
+ *
+ * Calling this method on an empty sequence will return 0.
+ *
+ * @throw XQException - if (1) the sequence is forward-only, or (2) the sequence is closed
+ */
@Override
public int getPosition() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Check if the sequence is positioned on an item or not.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence is currently positioned on an item, false if sequence is positioned before the first item, or after the last item
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean isOnItem() throws XQException {
isClosedXQException();
return (current!=null);
}
+ /** \brief Checks if the sequence is scrollable.
+ *
+ * @return true if the sequence can be scrolled backward or forward, false otherwise
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean isScrollable() throws XQException {
isClosedXQException();
return false;
}
+ /** \brief Moves to the first item in the sequence.
+ *
+ * The method returns true, if it was able to move to the first item in the sequence false, otherwise. Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence was positioned on the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean first() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Get the current item as an immutable XQItem object.
+ *
+ * In case of an XQResultSequence, the item is an XQResultItem. In the case of forward only sequences, this method or any other get or write method may only be called once on the curent item.
+ *
+ * The XQItem object is dependent on the sequence from which it was created and is only valid for the duration of XQSequence lifetime. Thus, the XQSequence is closed, this XQItem object will be implicitly closed and it can no longer be used.
+ *
+ * @return an XQItem object
+ * @throw XQException - if (1) there are errors retrieving the item, or (2) in the case of a forward only sequence, a get or write method has already been invoked on the current item.
+ */
@Override
public XQItem getItem() throws XQException {
isClosedXQException();
@@ -153,6 +271,13 @@
return current;
}
+ /** \brief Read the entire sequence starting from the current position as an XMLStreamReader object.
+ *
+ * Read the entire sequence starting from the current position as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the sequence. The operation on the stream is undefined if the underlying sequence position or state is changed by concurrent operations. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @return an XML reader object as XMLStreamReader
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the sequence into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0
+ */
@Override
public XMLStreamReader getSequenceAsStream() throws XQException {
isClosedXQException();
@@ -170,6 +295,14 @@
return result;
}
+ /** \brief Serializes the sequence starting from the current position to a String.
+ *
+ * Serializes the sequence starting from the current position to a String according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information. Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @return the serialized representation of the sequence
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, or (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item
+ */
@Override
public String getSequenceAsString(Properties prprts) throws XQException {
isClosedXQException();
@@ -201,36 +334,78 @@
return result;
}
+ /** \brief Checks if the current position is after the last item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is after the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isAfterLast() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Checks if the current position before the first item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is before the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isBeforeFirst() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Checks if the current position at the first item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is at the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isFirst() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Checks if the current position at the last item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is at the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isLast() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Moves to the last item in the sequence.
+ *
+ * This method returns true, if it was able to move to the last item in the sequence false, otherwise. Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence was positioned on the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean last() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Moves to the next item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the new item is valid, false if there are no more items
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean next() throws XQException {
isClosedXQException();
@@ -245,18 +420,42 @@
return (current != null);
}
+ /** \brief Moves to the previous item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the new current position is within the sequence, (i.e., not before first); false otherwise.
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state.
+ */
@Override
public boolean previous() throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Moves the cursor a relative number of items.
+ *
+ * Moves the cursor a relative number of items, either positive or negative. Attempting to move beyond the first/last item in the sequence positions the sequence before/after the the first/last item. Calling relative(0) is valid, but does not change the cursor position.
+ * Note: Calling the method relative(1) is identical to calling the method next and calling the method relative(-1) is identical to calling the method previous(). Calling this method on an empty sequence will return false.
+ *
+ * @param i - the item position to jump to
+ * @return true if the new current position is within the sequence (i.e., not before first or after last); false otherwise.
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state.
+ */
@Override
public boolean relative(int i) throws XQException {
isClosedXQException();
throw new XQException("This sequence is forward-only");
}
+ /** \brief Serializes the sequence starting from the current position to an OutputStream.
+ *
+ * Serializes the sequence starting from the current position to an OutputStream according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information. Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param out - the output stream into which the sequence is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (5) the os parameter is null
+ */
@Override
public void writeSequence(OutputStream out, Properties prprts) throws XQException {
isClosedXQException();
@@ -269,6 +468,18 @@
}
}
+ /** \brief Serializes the sequence starting from the current position to a Writer.
+ *
+ * Serializes the sequence starting from the current position to a Writer according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
+ *
+ * Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param writer - the writer object into which the sequence is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (5) the ow parameter is null
+ */
@Override
public void writeSequence(Writer writer, Properties prprts) throws XQException {
isClosedXQException();
@@ -281,6 +492,13 @@
}
}
+ /** \brief Writes the entire sequence starting from the current position to a SAX handler.
+ *
+ * Writes the entire sequence starting from the current position to a SAX handler, as described in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
+ *
+ * @param ch - the SAX content handler, optionally a lexical handler
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error during serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null
+ */
@Override
public void writeSequenceToSAX(ContentHandler ch) throws XQException {
isClosedXQException();
@@ -293,6 +511,17 @@
}
}
+ /** \brief Writes the entire sequence starting from the current position to a Result.
+ *
+ * First the sequence is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object.
+ * Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMResult
+ * - javax.xml.transform.sax.SAXResult
+ * - javax.xml.transform.stream.StreamResult
+ *
+ * @param result - the result object into which the sequence is to be serialized
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the sequence into the Result object, or (5) the result parameter is null
+ */
@Override
public void writeSequenceToResult(Result result) throws XQException {
isClosedXQException();
@@ -305,6 +534,13 @@
}
}
+ /** \brief Gets the current item as a boolean.
+ *
+ * The current item must be an atomic value of type xs:boolean or a subtype.
+ *
+ * @return a boolean representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a boolean fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public boolean getBoolean() throws XQException {
isClosedXQException();
@@ -312,6 +548,13 @@
return getItem().getBoolean();
}
+ /** \brief Gets the current item as a byte.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of byte.
+ *
+ * @return a byte representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a byte fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public byte getByte() throws XQException {
isClosedXQException();
@@ -319,13 +562,27 @@
return getItem().getByte();
}
+ /** \brief Gets the current item as a double.
+ *
+ * The current item must be an atomic value of type xs:double or a subtype.
+ *
+ * @return a double representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a double fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public double getDouble() throws XQException {
isClosedXQException();
-
+ isOnItemXQException();
return getItem().getDouble();
}
+ /** \brief Gets the current item as a float.
+ *
+ * The current item must be an atomic value of type xs:float or a subtype.
+ *
+ * @return a float representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a float fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public float getFloat() throws XQException {
isClosedXQException();
@@ -333,6 +590,13 @@
return getItem().getFloat();
}
+ /** \brief Gets the current item as an int.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of int.
+ *
+ * @return an int representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a int fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public int getInt() throws XQException {
isClosedXQException();
@@ -340,6 +604,13 @@
return getItem().getInt();
}
+ /** \brief Gets the type of the item.
+ *
+ * On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method.
+ *
+ * @return the type of the item
+ * @throw XQException - if (1) there are errors accessing the type of the item, or (2) the underlying sequence or item is in a closed state
+ */
@Override
public XQItemType getItemType() throws XQException {
isClosedXQException();
@@ -347,6 +618,13 @@
return current.getItemType();
}
+ /** \brief Gets the current item as a Java String.
+ *
+ * The current item must be an atomic value. This function casts the current item to an xs:string value according to the casting rules defined in 17.1.2 Casting to xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators, and then returns the value as a Java String.
+ *
+ * @return the string representation of the item
+ * @throw XQException - if (1) there are errors accessing the item's value, (2) the item is not an atomic value, (3) there is an error when casting the item to a string representation, (4) the underlying sequence or item is in a closed state, or (5) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public String getAtomicValue() throws XQException {
isClosedXQException();
@@ -354,6 +632,13 @@
return getItem().getAtomicValue();
}
+ /** \brief Gets the current item as a long.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of long.
+ *
+ * @return a long representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a long fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public long getLong() throws XQException {
isClosedXQException();
@@ -361,6 +646,13 @@
return getItem().getLong();
}
+ /** \brief Gets the item as a DOM node.
+ *
+ * The current item must be a node. The type of the returned DOM node is governed by Table 7 - XQuery Node Types and Corresponding Java Object Types XQuery API for Java (XQJ) 1.0 The instance of the returned node is implementation dependent. The node may be a reference or a copy of the internal state of the item. It is advisable to make a copy of the node if the application plans to modify it.
+ *
+ * @return a DOM node representing the current item
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public Node getNode() throws XQException {
isClosedXQException();
@@ -368,6 +660,14 @@
return getItem().getNode();
}
+ /** \brief Returns the URI for this item.
+ *
+ * If the item is a document node, then this method returns the absolute URI of the resource from which the document node was constructed. If the document URI is not available, then the empty string is returned. If the document URI is available, the returned value is the same as if fn:document-uri were evaluated on this document node. If the item is of a node kind other than document node, then the returned URI is implementation-defined.
+ * On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method on the current item.
+ *
+ * @return the document URI for this document node or the empty string if not available. For other node kinds, the result is implementation-defined
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state
+ */
@Override
public URI getNodeUri() throws XQException {
isClosedXQException();
@@ -375,6 +675,13 @@
return current.getNodeUri();
}
+ /** \brief Gets the current item as an Object.
+ *
+ * The data type of the returned object will be the Java Object type as specified in 14.4 Mapping an XQuery Atomic Value to a Java Object Type and 14.5 Mapping an XQuery Node to a Java Object Type, XQuery API for Java (XQJ) 1.0.
+ *
+ * @return an object representing the current item
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) if the underlying sequence or item is in a closed state, or (3) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public Object getObject() throws XQException {
isClosedXQException();
@@ -382,6 +689,13 @@
return getItem().getObject();
}
+ /** \brief Read the current item as an XMLStreamReader object.
+ *
+ * Read the current item as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the underlying item or sequence. The operation on the stream is undefined if the underlying sequence is repositioned or the state of the underlying item or sequence is changed by concurrent operations.
+ *
+ * @return an XML reader object as XMLStreamReader
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the current item into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0
+ */
@Override
public XMLStreamReader getItemAsStream() throws XQException {
isClosedXQException();
@@ -389,18 +703,61 @@
return getItem().getItemAsStream();
}
+ /** \brief Serializes the current item according to the XSLT 2.0 and XQuery 1.0 serialization.
+ *
+ * Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @return the serialized representation of the item
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) if there are errors during serialization
+ */
@Override
public String getItemAsString(Properties prprts) throws XQException {
isClosedXQException();
return getItem().getItemAsString(prprts);
}
+ /** \brief Gets the current item as a short.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of short.
+ *
+ * @return a short representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a short fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public short getShort() throws XQException {
isClosedXQException();
return getItem().getShort();
}
+ /** \brief Checks if the item "matches" an item type.
+ *
+ * Checks if the item "matches" an item type, as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language. You can use this method to first check the type of the result before calling the specific get methods.
+ *
+ * Example -
+ * \code{.java}
+ * ...
+ * XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ * XQItemType nodeType = conn.createNodeType();
+ *
+ * XQSequence result = preparedExpr.executeQuery();
+ * while (result.next())
+ * {
+ * // Generic check for node..
+ * if (result.instanceOf(nodeType))
+ * org.w3.dom.Node node = result.getNode();
+ * else if (result.instanceOf(strType))
+ * String str = result.getAtomicValue();
+ * }
+ *
+ *
+ * If either the type of the XQItemAccessor or the input XQItemType is not a built-in type, then this method is allowed to raise exception if it can NOT determine the instanceOf relationship due to the lack of the access of the XML schema that defines the user defined schema types if the XQMetaData.isUserDefinedXMLSchemaTypeSupported() method returns false.
+ * Otherwise, this method must determine if the type of the XQItemAccessor is an instance of the input XQItemType. Note even if isUserDefinedXMLSchemaTypeSupported() returns false, an XQJ implementation may still be able to determine the instanceOf relationship for certain cases involving user defined schema type. For example, if the type of an XQItemAccessor is of mySchema:hatSize sequence type and the input parameter XQItemType is of item() sequence type, the return value for instanceOf relationship should always be true even though the XQJ implementation does not know the precise type information of mySchema:hatSize type defined in XML schema 'mySchema'.
+ * \endcode
+ * @param xqit - item type to match
+ * @return true if this item matches the input item type as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language, and false if it does not
+ * @throw XQException - if (1) there are errors accessing the item's type, (2) if the underlying sequence or item is in a closed state, (3) if the implementation is unable to determine the schema definition of a user defined schema type, or (4) the type parameter is null
+ */
@Override
public boolean instanceOf(XQItemType xqit) throws XQException {
isClosedXQException();
@@ -409,6 +766,14 @@
return current.instanceOf(xqit);
}
+ /** \brief Serializes the current item to a Writer.
+ *
+ * Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * @param out - the output stream into which the current item is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null
+ */
@Override
public void writeItem(OutputStream out, Properties prprts) throws XQException {
isClosedXQException();
@@ -417,6 +782,15 @@
getItem().writeItem(out, prprts);
}
+ /** \brief Serializes the current item to a Writer.
+ *
+ * Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
+ * @param writer - the output stream into which the current item is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null
+ */
@Override
public void writeItem(Writer writer, Properties prprts) throws XQException {
isClosedXQException();
@@ -425,6 +799,13 @@
getItem().writeItem(writer, prprts);
}
+ /** \brief Writes the current item to a SAX handler.
+ *
+ * Writes the current item to a SAX handler, as described in in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
+ *
+ * @param saxhdlr - the SAX content handler, optionally a lexical handler
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null
+ */
@Override
public void writeItemToSAX(ContentHandler ch) throws XQException {
isClosedXQException();
@@ -432,13 +813,32 @@
getItem().writeItemToSAX(ch);
}
+ /** \brief Writes the current item to a Result.
+ *
+ * First the item is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object.
+ * Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMResult
+ * - javax.xml.transform.sax.SAXResult
+ * - javax.xml.transform.stream.StreamResult
+ *
+ * @param result - the result object into which the item is to be serialized
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the current item into the Result object, or (5) the result parameter is null
+ */
@Override
public void writeItemToResult(Result result) throws XQException {
isClosedXQException();
isNullXQException(result);
getItem().writeItemToResult(result);
}
-
+
+ /** \brief Returns a StaticCollectionManager.
+ *
+ * Returns a CollectionManager responsible for all collections which are statically declared in the static context of this query (main module) or any transitively imported library module.
+ * The collection manager provides a set of functions for managing collections and their contents.
+ *
+ * @return XQStaticCollectionManager The collection manager responsible for managing collections of this Sequence.
+ * @throw XQException - if the object is closed
+ */
public XQStaticCollectionManager getStaticCollectionManager() throws XQException {
isClosedXQException();
if (lStaticCollectionManager==null) {
=== modified file 'swig/xqj/XQResultSequenceScrollable.java'
--- swig/xqj/XQResultSequenceScrollable.java 2012-05-03 12:31:51 +0000
+++ swig/xqj/XQResultSequenceScrollable.java 2012-05-14 18:27:25 +0000
@@ -37,6 +37,43 @@
import org.zorbaxquery.api.Item;
import org.zorbaxquery.api.Iterator;
+ /**
+ * This class represents a sequence of items obtained as a result of evaluation XQuery expressions. The result sequence is tied to the XQconnection object on which the expression was evaluated.
+ *
+ * This sequence can be obtained by performing an executeQuery on the expression object. It represents a cursor-like class.
+ *
+ * The XQResultSequence object is dependent on the connection and the expression from which it was created and is only valid for the duration of those objects. Thus, if any one of those objects is closed, this XQResultSequence object will be implicitly closed and it can no longer be used. Similarly re-executing the expression also implicitly closes the associated result sequences.
+ *
+ * An XQJ driver is not required to provide finalizer methods for the connection and other objects. Hence it is strongly recommended that users call close method explicitly to free any resources. It is also recommended that they do so under a final block to ensure that the object is closed even when there are exceptions. Not closing this object implicitly or explicitly might result in serious memory leaks.
+ *
+ * When the XQResultSequence is closed any XQResultItem objects obtained from it are also implicitly closed.
+ *
+ * Example -
+ *
+ * \code{.java}
+ * XQPreparedExpression expr = conn.prepareExpression("for $i ..");
+ * XQResultSequence result = expr.executeQuery();
+ *
+ * // create the ItemTypes for string and integer
+ * XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ * XQItemType intType = conn.createAtomicType(XQItemType.XQBASETYPE_INT);
+ *
+ * // posititioned before the first item
+ * while (result.next())
+ * {
+ * XQItemType type = result.getItemType();
+ *
+ * // If string, then get the string value out
+ * if (type.equals(strType))
+ * String str = result.getAtomicValue();
+ * else if (type.equals(intType)) // if it is an integer..
+ * int intval = result.getInt();
+ * ...
+ * }
+ *
+ * result.close(); // explicitly close the result sequence
+ * \endcode
+ */
public class XQResultSequenceScrollable implements javax.xml.xquery.XQResultSequence {
private boolean closed = false;
@@ -67,6 +104,23 @@
lQuery = query;
}
+ /** \brief Moves the XQSequence's position to the given item number in this object.
+ *
+ * If the item number is positive, the XQSequence moves to the given item number with respect to the beginning of the XQSequence.
+ * The first item is item 1, the second is item 2, and so on.
+ *
+ * If the given item number is negative, the XQSequence positions itself on an absolute item position with respect to the end of the sequence.
+ *
+ * For example, calling the method absolute(-1) positions the XQSequence on the last item; calling the method absolute(-2) moves the XQSequence to the next-to-last item, and so on. absolute(0) will position the sequence before the first item.
+ *
+ * An attempt to position the sequence beyond the first/last item set leaves the current position to be before the first item or after the last item.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @param i - the item position to jump to
+ * @return true if the current position is within the sequence, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean absolute(int i) throws XQException {
isClosedXQException();
@@ -90,18 +144,32 @@
return result;
}
+ /** \brief Move to the position after the last item.
+ *
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public void afterLast() throws XQException {
isClosedXQException();
position = size+1;
}
+ /** \brief Moves to the position before the first item.
+ *
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public void beforeFirst() throws XQException {
isClosedXQException();
position = 0;
}
+ /** \brief Closes the sequence and frees all resources associated with this sequence.
+ *
+ * Closing an XQSequence object also implicitly closes all XQItem objects obtained from it. All methods other than the isClosed or close method will raise exceptions when invoked after closing the sequence. Calling close on an XQSequence object that is already closed has no effect.
+ *
+ * @throw XQException - if there are errors during closing of the sequence
+ */
@Override
public void close() throws XQException {
closed = true;
@@ -113,35 +181,71 @@
}
}
+ /** \brief Checks if the sequence is closed.
+ *
+ * @return true if the sequence is in a closed state, false otherwise
+ */
@Override
public boolean isClosed() {
return closed;
}
+ /** \brief Returns a number indicating the number of items in the sequence.
+ *
+ * @return the number of items in this sequence
+ * @throw XQException - if (1) the sequence is forward-only, or (2) the sequence is closed
+ */
@Override
public int count() throws XQException {
isClosedXQException();
return size;
}
+ /** \brief Gets the current cursor position.
+ *
+ * 0 indicates that the position is before the first item and count() + 1 indicates position after the last item. A specific position indicates that the cursor is positioned on the item at that position. Use the isOnItem method to verify if the cursor is positioned on the item.
+ *
+ * Calling this method on an empty sequence will return 0.
+ *
+ * @throw XQException - if (1) the sequence is forward-only, or (2) the sequence is closed
+ */
@Override
public int getPosition() throws XQException {
isClosedXQException();
return position;
}
+ /** \brief Check if the sequence is positioned on an item or not.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence is currently positioned on an item, false if sequence is positioned before the first item, or after the last item
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean isOnItem() throws XQException {
isClosedXQException();
return (position>0) && (position<(content.size()+1));
}
+ /** \brief Checks if the sequence is scrollable.
+ *
+ * @return true if the sequence can be scrolled backward or forward, false otherwise
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean isScrollable() throws XQException {
isClosedXQException();
return !forwardOnly;
}
+ /** \brief Moves to the first item in the sequence.
+ *
+ * The method returns true, if it was able to move to the first item in the sequence false, otherwise. Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence was positioned on the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean first() throws XQException {
isClosedXQException();
@@ -153,6 +257,15 @@
return result;
}
+ /** \brief Get the current item as an immutable XQItem object.
+ *
+ * In case of an XQResultSequence, the item is an XQResultItem. In the case of forward only sequences, this method or any other get or write method may only be called once on the curent item.
+ *
+ * The XQItem object is dependent on the sequence from which it was created and is only valid for the duration of XQSequence lifetime. Thus, the XQSequence is closed, this XQItem object will be implicitly closed and it can no longer be used.
+ *
+ * @return an XQItem object
+ * @throw XQException - if (1) there are errors retrieving the item, or (2) in the case of a forward only sequence, a get or write method has already been invoked on the current item.
+ */
@Override
public XQItem getItem() throws XQException {
isClosedXQException();
@@ -160,6 +273,13 @@
return (XQItem)content.toArray()[position-1];
}
+ /** \brief Read the entire sequence starting from the current position as an XMLStreamReader object.
+ *
+ * Read the entire sequence starting from the current position as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the sequence. The operation on the stream is undefined if the underlying sequence position or state is changed by concurrent operations. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @return an XML reader object as XMLStreamReader
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the sequence into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0
+ */
@Override
public XMLStreamReader getSequenceAsStream() throws XQException {
isClosedXQException();
@@ -179,6 +299,14 @@
return result;
}
+ /** \brief Serializes the sequence starting from the current position to a String.
+ *
+ * Serializes the sequence starting from the current position to a String according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information. Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @return the serialized representation of the sequence
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, or (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item
+ */
@Override
public String getSequenceAsString(Properties prprts) throws XQException {
isClosedXQException();
@@ -190,6 +318,13 @@
return sb.toString();
}
+ /** \brief Checks if the current position is after the last item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is after the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isAfterLast() throws XQException {
isClosedXQException();
@@ -200,6 +335,13 @@
return result;
}
+ /** \brief Checks if the current position before the first item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is before the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isBeforeFirst() throws XQException {
isClosedXQException();
@@ -210,6 +352,13 @@
return result;
}
+ /** \brief Checks if the current position at the first item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is at the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isFirst() throws XQException {
isClosedXQException();
@@ -220,6 +369,13 @@
return result;
}
+ /** \brief Checks if the current position at the last item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is at the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isLast() throws XQException {
isClosedXQException();
@@ -230,6 +386,13 @@
return result;
}
+ /** \brief Moves to the last item in the sequence.
+ *
+ * This method returns true, if it was able to move to the last item in the sequence false, otherwise. Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence was positioned on the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean last() throws XQException {
isClosedXQException();
@@ -241,6 +404,13 @@
return result;
}
+ /** \brief Moves to the next item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the new item is valid, false if there are no more items
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean next() throws XQException {
isClosedXQException();
@@ -252,6 +422,13 @@
return result;
}
+ /** \brief Moves to the previous item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the new current position is within the sequence, (i.e., not before first); false otherwise.
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state.
+ */
@Override
public boolean previous() throws XQException {
isClosedXQException();
@@ -263,6 +440,15 @@
return result;
}
+ /** \brief Moves the cursor a relative number of items.
+ *
+ * Moves the cursor a relative number of items, either positive or negative. Attempting to move beyond the first/last item in the sequence positions the sequence before/after the the first/last item. Calling relative(0) is valid, but does not change the cursor position.
+ * Note: Calling the method relative(1) is identical to calling the method next and calling the method relative(-1) is identical to calling the method previous(). Calling this method on an empty sequence will return false.
+ *
+ * @param i - the item position to jump to
+ * @return true if the new current position is within the sequence (i.e., not before first or after last); false otherwise.
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state.
+ */
@Override
public boolean relative(int i) throws XQException {
isClosedXQException();
@@ -280,6 +466,14 @@
return result;
}
+ /** \brief Serializes the sequence starting from the current position to an OutputStream.
+ *
+ * Serializes the sequence starting from the current position to an OutputStream according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information. Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param out - the output stream into which the sequence is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (5) the os parameter is null
+ */
@Override
public void writeSequence(OutputStream out, Properties prprts) throws XQException {
isClosedXQException();
@@ -292,6 +486,18 @@
}
}
+ /** \brief Serializes the sequence starting from the current position to a Writer.
+ *
+ * Serializes the sequence starting from the current position to a Writer according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
+ *
+ * Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param writer - the writer object into which the sequence is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (5) the ow parameter is null
+ */
@Override
public void writeSequence(Writer writer, Properties prprts) throws XQException {
isClosedXQException();
@@ -304,6 +510,13 @@
}
}
+ /** \brief Writes the entire sequence starting from the current position to a SAX handler.
+ *
+ * Writes the entire sequence starting from the current position to a SAX handler, as described in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
+ *
+ * @param ch - the SAX content handler, optionally a lexical handler
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error during serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null
+ */
@Override
public void writeSequenceToSAX(ContentHandler ch) throws XQException {
isClosedXQException();
@@ -316,6 +529,17 @@
}
}
+ /** \brief Writes the entire sequence starting from the current position to a Result.
+ *
+ * First the sequence is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object.
+ * Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMResult
+ * - javax.xml.transform.sax.SAXResult
+ * - javax.xml.transform.stream.StreamResult
+ *
+ * @param result - the result object into which the sequence is to be serialized
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the sequence into the Result object, or (5) the result parameter is null
+ */
@Override
public void writeSequenceToResult(Result result) throws XQException {
isClosedXQException();
@@ -328,89 +552,217 @@
}
}
+ /** \brief Gets the current item as a boolean.
+ *
+ * The current item must be an atomic value of type xs:boolean or a subtype.
+ *
+ * @return a boolean representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a boolean fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public boolean getBoolean() throws XQException {
isClosedXQException();
return getItem().getBoolean();
}
+ /** \brief Gets the current item as a byte.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of byte.
+ *
+ * @return a byte representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a byte fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public byte getByte() throws XQException {
isClosedXQException();
return getItem().getByte();
}
+ /** \brief Gets the current item as a double.
+ *
+ * The current item must be an atomic value of type xs:double or a subtype.
+ *
+ * @return a double representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a double fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public double getDouble() throws XQException {
isClosedXQException();
return getItem().getDouble();
}
+ /** \brief Gets the current item as a float.
+ *
+ * The current item must be an atomic value of type xs:float or a subtype.
+ *
+ * @return a float representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a float fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public float getFloat() throws XQException {
isClosedXQException();
return getItem().getFloat();
}
+ /** \brief Gets the current item as an int.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of int.
+ *
+ * @return an int representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a int fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public int getInt() throws XQException {
isClosedXQException();
return getItem().getInt();
}
+ /** \brief Gets the type of the item.
+ *
+ * On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method.
+ *
+ * @return the type of the item
+ * @throw XQException - if (1) there are errors accessing the type of the item, or (2) the underlying sequence or item is in a closed state
+ */
@Override
public XQItemType getItemType() throws XQException {
isClosedXQException();
return getItem().getItemType();
}
+ /** \brief Gets the current item as a Java String.
+ *
+ * The current item must be an atomic value. This function casts the current item to an xs:string value according to the casting rules defined in 17.1.2 Casting to xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators, and then returns the value as a Java String.
+ *
+ * @return the string representation of the item
+ * @throw XQException - if (1) there are errors accessing the item's value, (2) the item is not an atomic value, (3) there is an error when casting the item to a string representation, (4) the underlying sequence or item is in a closed state, or (5) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public String getAtomicValue() throws XQException {
isClosedXQException();
return getItem().getAtomicValue();
}
+ /** \brief Gets the current item as a long.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of long.
+ *
+ * @return a long representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a long fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public long getLong() throws XQException {
isClosedXQException();
return getItem().getLong();
}
+ /** \brief Gets the item as a DOM node.
+ *
+ * The current item must be a node. The type of the returned DOM node is governed by Table 7 - XQuery Node Types and Corresponding Java Object Types XQuery API for Java (XQJ) 1.0 The instance of the returned node is implementation dependent. The node may be a reference or a copy of the internal state of the item. It is advisable to make a copy of the node if the application plans to modify it.
+ *
+ * @return a DOM node representing the current item
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public Node getNode() throws XQException {
isClosedXQException();
return getItem().getNode();
}
+ /** \brief Returns the URI for this item.
+ *
+ * If the item is a document node, then this method returns the absolute URI of the resource from which the document node was constructed. If the document URI is not available, then the empty string is returned. If the document URI is available, the returned value is the same as if fn:document-uri were evaluated on this document node. If the item is of a node kind other than document node, then the returned URI is implementation-defined.
+ * On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method on the current item.
+ *
+ * @return the document URI for this document node or the empty string if not available. For other node kinds, the result is implementation-defined
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state
+ */
@Override
public URI getNodeUri() throws XQException {
isClosedXQException();
return getItem().getNodeUri();
}
+ /** \brief Gets the current item as an Object.
+ *
+ * The data type of the returned object will be the Java Object type as specified in 14.4 Mapping an XQuery Atomic Value to a Java Object Type and 14.5 Mapping an XQuery Node to a Java Object Type, XQuery API for Java (XQJ) 1.0.
+ *
+ * @return an object representing the current item
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) if the underlying sequence or item is in a closed state, or (3) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public Object getObject() throws XQException {
isClosedXQException();
return getItem().getObject();
}
+ /** \brief Read the current item as an XMLStreamReader object.
+ *
+ * Read the current item as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the underlying item or sequence. The operation on the stream is undefined if the underlying sequence is repositioned or the state of the underlying item or sequence is changed by concurrent operations.
+ *
+ * @return an XML reader object as XMLStreamReader
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the current item into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0
+ */
@Override
public XMLStreamReader getItemAsStream() throws XQException {
isClosedXQException();
return getItem().getItemAsStream();
}
+ /** \brief Serializes the current item according to the XSLT 2.0 and XQuery 1.0 serialization.
+ *
+ * Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @return the serialized representation of the item
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) if there are errors during serialization
+ */
@Override
public String getItemAsString(Properties prprts) throws XQException {
return getItem().getItemAsString(prprts);
}
+ /** \brief Gets the current item as a short.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of short.
+ *
+ * @return a short representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a short fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public short getShort() throws XQException {
isClosedXQException();
return getItem().getShort();
}
+ /** \brief Checks if the item "matches" an item type.
+ *
+ * Checks if the item "matches" an item type, as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language. You can use this method to first check the type of the result before calling the specific get methods.
+ *
+ * Example -
+ * \code{.java}
+ * ...
+ * XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ * XQItemType nodeType = conn.createNodeType();
+ *
+ * XQSequence result = preparedExpr.executeQuery();
+ * while (result.next())
+ * {
+ * // Generic check for node..
+ * if (result.instanceOf(nodeType))
+ * org.w3.dom.Node node = result.getNode();
+ * else if (result.instanceOf(strType))
+ * String str = result.getAtomicValue();
+ * }
+ *
+ *
+ * If either the type of the XQItemAccessor or the input XQItemType is not a built-in type, then this method is allowed to raise exception if it can NOT determine the instanceOf relationship due to the lack of the access of the XML schema that defines the user defined schema types if the XQMetaData.isUserDefinedXMLSchemaTypeSupported() method returns false.
+ * Otherwise, this method must determine if the type of the XQItemAccessor is an instance of the input XQItemType. Note even if isUserDefinedXMLSchemaTypeSupported() returns false, an XQJ implementation may still be able to determine the instanceOf relationship for certain cases involving user defined schema type. For example, if the type of an XQItemAccessor is of mySchema:hatSize sequence type and the input parameter XQItemType is of item() sequence type, the return value for instanceOf relationship should always be true even though the XQJ implementation does not know the precise type information of mySchema:hatSize type defined in XML schema 'mySchema'.
+ * \endcode
+ * @param xqit - item type to match
+ * @return true if this item matches the input item type as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language, and false if it does not
+ * @throw XQException - if (1) there are errors accessing the item's type, (2) if the underlying sequence or item is in a closed state, (3) if the implementation is unable to determine the schema definition of a user defined schema type, or (4) the type parameter is null
+ */
@Override
public boolean instanceOf(XQItemType xqit) throws XQException {
isClosedXQException();
@@ -418,6 +770,14 @@
return getItem().instanceOf(xqit);
}
+ /** \brief Serializes the current item to a Writer.
+ *
+ * Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * @param out - the output stream into which the current item is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null
+ */
@Override
public void writeItem(OutputStream out, Properties prprts) throws XQException {
isClosedXQException();
@@ -425,6 +785,15 @@
getItem().writeItem(out, prprts);
}
+ /** \brief Serializes the current item to a Writer.
+ *
+ * Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
+ * @param writer - the output stream into which the current item is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null
+ */
@Override
public void writeItem(Writer writer, Properties prprts) throws XQException {
isClosedXQException();
@@ -432,6 +801,13 @@
getItem().writeItem(writer, prprts);
}
+ /** \brief Writes the current item to a SAX handler.
+ *
+ * Writes the current item to a SAX handler, as described in in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
+ *
+ * @param saxhdlr - the SAX content handler, optionally a lexical handler
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null
+ */
@Override
public void writeItemToSAX(ContentHandler ch) throws XQException {
isClosedXQException();
@@ -439,6 +815,17 @@
getItem().writeItemToSAX(ch);
}
+ /** \brief Writes the current item to a Result.
+ *
+ * First the item is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object.
+ * Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMResult
+ * - javax.xml.transform.sax.SAXResult
+ * - javax.xml.transform.stream.StreamResult
+ *
+ * @param result - the result object into which the item is to be serialized
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the current item into the Result object, or (5) the result parameter is null
+ */
@Override
public void writeItemToResult(Result result) throws XQException {
isClosedXQException();
@@ -446,6 +833,14 @@
getItem().writeItemToResult(result);
}
+ /** \brief Returns a StaticCollectionManager.
+ *
+ * Returns a CollectionManager responsible for all collections which are statically declared in the static context of this query (main module) or any transitively imported library module.
+ * The collection manager provides a set of functions for managing collections and their contents.
+ *
+ * @return XQStaticCollectionManager The collection manager responsible for managing collections of this Sequence.
+ * @throw XQException - if the object is closed
+ */
public XQStaticCollectionManager getStaticCollectionManager() throws XQException {
isClosedXQException();
if (lStaticCollectionManager==null) {
@@ -471,6 +866,11 @@
}
+ /** \brief Gets the XQuery connection associated with this result sequence
+ *
+ * @return the connection associated with this result sequence
+ * @throw XQException - if the result sequence is in a closed state
+ */
@Override
public XQConnection getConnection() throws XQException {
throw new UnsupportedOperationException("Not supported yet.");
=== modified file 'swig/xqj/XQSequence.java'
--- swig/xqj/XQSequence.java 2012-05-03 12:31:51 +0000
+++ swig/xqj/XQSequence.java 2012-05-14 18:27:25 +0000
@@ -36,6 +36,45 @@
import org.zorbaxquery.api.ItemSequence;
import org.zorbaxquery.api.Iterator;
+
+ /**
+ *
+ * This interface represents a sequence of items as defined in the XDM. The sequence may be materialized or non-materialized.
+ *
+ * The next method is useful to position the XQSequence over the next item in the sequence. If the scrollability is XQConstants.SCROLLTYPE_SCROLLABLE, then the previous method can be called to move backwards. In the case of a forward only sequence, the get methods may be only called once per item. To perform multiple gets on an item, extract the item first from the sequence using the getItem method and then operate on the XQItem object.
+ *
+ * \code{.java}
+ * XQPreparedExpression expr = conn.prepareExpression("for $i ..");
+ * XQSequence result = expr.executeQuery();
+ *
+ * // create the ItemTypes for string and integer
+ * XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ * XQItemType intType = conn.createAtomicType(XQItemType.XQBASETYPE_INT);
+ *
+ * // positioned before the first item
+ * while (result.next())
+ * {
+ * XQItemType type = result.getItemType();
+ *
+ * // If string, then get the string value out
+ * if (type.equals(strType))
+ * String str = result.getAtomicValue();
+ * else if (type.equals(intType)) // if it is an integer..
+ * int intval = result.getInt();
+ *
+ * ...
+ * }
+ * \endcode
+ *
+ * In a sequence, the cursor may be positioned on an item, after the last item or before the first item. The getPosition method returns the current position number. A value of 0 indicates that it is positioned before the first item, a value of count() + 1 indicates that it is positioned after the last item, and any other value indicates that it is positioned on the item at that position.
+ * For example, a position value of 1 indicates that it is positioned on the item at position 1.
+ *
+ * The isOnItem method may be used to find out if the cursor is positioned on the item. When the cursor is positioned on an item, the next method call will move the cursor to be on the next item.
+ *
+ * See also: Section 12 Serialization, XQuery API for Java (XQJ) 1.0, which describes some general information applicable to various XQJ serialization methods.
+ *
+ *
+ */
public class XQSequence implements javax.xml.xquery.XQSequence {
private boolean closed = false;
@@ -111,7 +150,24 @@
}
return itemSequence;
}
-
+
+ /** \brief Moves the XQSequence's position to the given item number in this object.
+ *
+ * If the item number is positive, the XQSequence moves to the given item number with respect to the beginning of the XQSequence.
+ * The first item is item 1, the second is item 2, and so on.
+ *
+ * If the given item number is negative, the XQSequence positions itself on an absolute item position with respect to the end of the sequence.
+ *
+ * For example, calling the method absolute(-1) positions the XQSequence on the last item; calling the method absolute(-2) moves the XQSequence to the next-to-last item, and so on. absolute(0) will position the sequence before the first item.
+ *
+ * An attempt to position the sequence beyond the first/last item set leaves the current position to be before the first item or after the last item.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @param i - the item position to jump to
+ * @return true if the current position is within the sequence, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean absolute(int i) throws XQException {
isClosedXQException();
@@ -135,18 +191,32 @@
return result;
}
+ /** \brief Move to the position after the last item.
+ *
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public void afterLast() throws XQException {
isClosedXQException();
position = content.size()+1;
}
+ /** \brief Moves to the position before the first item.
+ *
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public void beforeFirst() throws XQException {
isClosedXQException();
position = 0;
}
+ /** \brief Closes the sequence and frees all resources associated with this sequence.
+ *
+ * Closing an XQSequence object also implicitly closes all XQItem objects obtained from it. All methods other than the isClosed or close method will raise exceptions when invoked after closing the sequence. Calling close on an XQSequence object that is already closed has no effect.
+ *
+ * @throw XQException - if there are errors during closing of the sequence
+ */
@Override
public void close() throws XQException {
closed = true;
@@ -158,35 +228,71 @@
}
}
+ /** \brief Checks if the sequence is closed.
+ *
+ * @return true if the sequence is in a closed state, false otherwise
+ */
@Override
public boolean isClosed() {
return closed;
}
+ /** \brief Returns a number indicating the number of items in the sequence.
+ *
+ * @return the number of items in this sequence
+ * @throw XQException - if (1) the sequence is forward-only, or (2) the sequence is closed
+ */
@Override
public int count() throws XQException {
isClosedXQException();
return size;
}
+ /** \brief Gets the current cursor position.
+ *
+ * 0 indicates that the position is before the first item and count() + 1 indicates position after the last item. A specific position indicates that the cursor is positioned on the item at that position. Use the isOnItem method to verify if the cursor is positioned on the item.
+ *
+ * Calling this method on an empty sequence will return 0.
+ *
+ * @throw XQException - if (1) the sequence is forward-only, or (2) the sequence is closed
+ */
@Override
public int getPosition() throws XQException {
isClosedXQException();
return position;
}
+ /** \brief Check if the sequence is positioned on an item or not.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence is currently positioned on an item, false if sequence is positioned before the first item, or after the last item
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean isOnItem() throws XQException {
isClosedXQException();
return (position>0) && (position<(content.size()+1));
}
+ /** \brief Checks if the sequence is scrollable.
+ *
+ * @return true if the sequence can be scrolled backward or forward, false otherwise
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean isScrollable() throws XQException {
isClosedXQException();
return !forwardOnly;
}
+ /** \brief Moves to the first item in the sequence.
+ *
+ * The method returns true, if it was able to move to the first item in the sequence false, otherwise. Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence was positioned on the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean first() throws XQException {
isClosedXQException();
@@ -198,6 +304,15 @@
return result;
}
+ /** \brief Get the current item as an immutable XQItem object.
+ *
+ * In case of an XQResultSequence, the item is an XQResultItem. In the case of forward only sequences, this method or any other get or write method may only be called once on the curent item.
+ *
+ * The XQItem object is dependent on the sequence from which it was created and is only valid for the duration of XQSequence lifetime. Thus, the XQSequence is closed, this XQItem object will be implicitly closed and it can no longer be used.
+ *
+ * @return an XQItem object
+ * @throw XQException - if (1) there are errors retrieving the item, or (2) in the case of a forward only sequence, a get or write method has already been invoked on the current item.
+ */
@Override
public XQItem getItem() throws XQException {
isClosedXQException();
@@ -205,6 +320,13 @@
return (XQItem)content.toArray()[position-1];
}
+ /** \brief Read the entire sequence starting from the current position as an XMLStreamReader object.
+ *
+ * Read the entire sequence starting from the current position as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the sequence. The operation on the stream is undefined if the underlying sequence position or state is changed by concurrent operations. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @return an XML reader object as XMLStreamReader
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the sequence into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0
+ */
@Override
public XMLStreamReader getSequenceAsStream() throws XQException {
isClosedXQException();
@@ -224,6 +346,14 @@
return result;
}
+ /** \brief Serializes the sequence starting from the current position to a String.
+ *
+ * Serializes the sequence starting from the current position to a String according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information. Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @return the serialized representation of the sequence
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, or (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item
+ */
@Override
public String getSequenceAsString(Properties prprts) throws XQException {
isClosedXQException();
@@ -235,6 +365,13 @@
return sb.toString();
}
+ /** \brief Checks if the current position is after the last item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is after the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isAfterLast() throws XQException {
isClosedXQException();
@@ -245,6 +382,13 @@
return result;
}
+ /** \brief Checks if the current position before the first item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is before the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isBeforeFirst() throws XQException {
isClosedXQException();
@@ -255,6 +399,13 @@
return result;
}
+ /** \brief Checks if the current position at the first item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is at the first item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isFirst() throws XQException {
isClosedXQException();
@@ -265,6 +416,13 @@
return result;
}
+ /** \brief Checks if the current position at the last item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the current position is at the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean isLast() throws XQException {
isClosedXQException();
@@ -275,6 +433,13 @@
return result;
}
+ /** \brief Moves to the last item in the sequence.
+ *
+ * This method returns true, if it was able to move to the last item in the sequence false, otherwise. Calling this method on an empty sequence will return false.
+ *
+ * @return true if the sequence was positioned on the last item, false otherwise
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state
+ */
@Override
public boolean last() throws XQException {
isClosedXQException();
@@ -286,6 +451,13 @@
return result;
}
+ /** \brief Moves to the next item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the new item is valid, false if there are no more items
+ * @throw XQException - if the sequence is in a closed state
+ */
@Override
public boolean next() throws XQException {
isClosedXQException();
@@ -297,6 +469,13 @@
return result;
}
+ /** \brief Moves to the previous item in the sequence.
+ *
+ * Calling this method on an empty sequence will return false.
+ *
+ * @return true if the new current position is within the sequence, (i.e., not before first); false otherwise.
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state.
+ */
@Override
public boolean previous() throws XQException {
isClosedXQException();
@@ -308,6 +487,15 @@
return result;
}
+ /** \brief Moves the cursor a relative number of items.
+ *
+ * Moves the cursor a relative number of items, either positive or negative. Attempting to move beyond the first/last item in the sequence positions the sequence before/after the the first/last item. Calling relative(0) is valid, but does not change the cursor position.
+ * Note: Calling the method relative(1) is identical to calling the method next and calling the method relative(-1) is identical to calling the method previous(). Calling this method on an empty sequence will return false.
+ *
+ * @param i - the item position to jump to
+ * @return true if the new current position is within the sequence (i.e., not before first or after last); false otherwise.
+ * @throw XQException - if (1) the sequence is forward only, or (2) the sequence is in a closed state.
+ */
@Override
public boolean relative(int i) throws XQException {
isClosedXQException();
@@ -325,6 +513,14 @@
return result;
}
+ /** \brief Serializes the sequence starting from the current position to an OutputStream.
+ *
+ * Serializes the sequence starting from the current position to an OutputStream according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information. Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param out - the output stream into which the sequence is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (5) the os parameter is null
+ */
@Override
public void writeSequence(OutputStream out, Properties prprts) throws XQException {
isClosedXQException();
@@ -338,6 +534,18 @@
}
}
+ /** \brief Serializes the sequence starting from the current position to a Writer.
+ *
+ * Serializes the sequence starting from the current position to a Writer according to the XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
+ *
+ * Reading the sequence during the serialization process performs implicit next operations to read the items. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods.
+ *
+ * @param writer - the writer object into which the sequence is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the items in the sequence, (2) there are errors during serialization, (3) the sequence is in a closed state, (4) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (5) the ow parameter is null
+ */
@Override
public void writeSequence(Writer writer, Properties prprts) throws XQException {
isClosedXQException();
@@ -351,6 +559,13 @@
}
}
+ /** \brief Writes the entire sequence starting from the current position to a SAX handler.
+ *
+ * Writes the entire sequence starting from the current position to a SAX handler, as described in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. After all items are written to the stream, the current position of the cursor is set to point after the last item. Also, in the case of forward only sequences, this method may only be called if the current item has not yet been read through any of the get or write methods. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
+ *
+ * @param ch - the SAX content handler, optionally a lexical handler
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error during serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null
+ */
@Override
public void writeSequenceToSAX(ContentHandler ch) throws XQException {
isClosedXQException();
@@ -364,6 +579,17 @@
}
}
+ /** \brief Writes the entire sequence starting from the current position to a Result.
+ *
+ * First the sequence is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object.
+ * Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMResult
+ * - javax.xml.transform.sax.SAXResult
+ * - javax.xml.transform.stream.StreamResult
+ *
+ * @param result - the result object into which the sequence is to be serialized
+ * @throw XQException - if (1) there are errors accessing any of the items in the sequence, (2) the sequence is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the sequence into the Result object, or (5) the result parameter is null
+ */
@Override
public void writeSequenceToResult(Result result) throws XQException {
isClosedXQException();
@@ -377,90 +603,218 @@
}
}
+ /** \brief Gets the current item as a boolean.
+ *
+ * The current item must be an atomic value of type xs:boolean or a subtype.
+ *
+ * @return a boolean representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a boolean fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public boolean getBoolean() throws XQException {
isClosedXQException();
return getItem().getBoolean();
}
+ /** \brief Gets the current item as a byte.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of byte.
+ *
+ * @return a byte representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a byte fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public byte getByte() throws XQException {
isClosedXQException();
return getItem().getByte();
}
+ /** \brief Gets the current item as a double.
+ *
+ * The current item must be an atomic value of type xs:double or a subtype.
+ *
+ * @return a double representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a double fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public double getDouble() throws XQException {
isClosedXQException();
return getItem().getDouble();
}
+ /** \brief Gets the current item as a float.
+ *
+ * The current item must be an atomic value of type xs:float or a subtype.
+ *
+ * @return a float representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a float fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public float getFloat() throws XQException {
isClosedXQException();
return getItem().getFloat();
}
+ /** \brief Gets the current item as an int.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of int.
+ *
+ * @return an int representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a int fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public int getInt() throws XQException {
isClosedXQException();
return getItem().getInt();
}
+ /** \brief Gets the type of the item.
+ *
+ * On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method.
+ *
+ * @return the type of the item
+ * @throw XQException - if (1) there are errors accessing the type of the item, or (2) the underlying sequence or item is in a closed state
+ */
@Override
public XQItemType getItemType() throws XQException {
isClosedXQException();
return getItem().getItemType();
}
+ /** \brief Gets the current item as a Java String.
+ *
+ * The current item must be an atomic value. This function casts the current item to an xs:string value according to the casting rules defined in 17.1.2 Casting to xs:string and xs:untypedAtomic, XQuery 1.0 and XPath 2.0 Functions and Operators, and then returns the value as a Java String.
+ *
+ * @return the string representation of the item
+ * @throw XQException - if (1) there are errors accessing the item's value, (2) the item is not an atomic value, (3) there is an error when casting the item to a string representation, (4) the underlying sequence or item is in a closed state, or (5) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public String getAtomicValue() throws XQException {
isClosedXQException();
return getItem().getAtomicValue();
}
+ /** \brief Gets the current item as a long.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of long.
+ *
+ * @return a long representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a long fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public long getLong() throws XQException {
isClosedXQException();
return getItem().getLong();
}
+ /** \brief Gets the item as a DOM node.
+ *
+ * The current item must be a node. The type of the returned DOM node is governed by Table 7 - XQuery Node Types and Corresponding Java Object Types XQuery API for Java (XQJ) 1.0 The instance of the returned node is implementation dependent. The node may be a reference or a copy of the internal state of the item. It is advisable to make a copy of the node if the application plans to modify it.
+ *
+ * @return a DOM node representing the current item
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public Node getNode() throws XQException {
isClosedXQException();
return getItem().getNode();
}
+ /** \brief Returns the URI for this item.
+ *
+ * If the item is a document node, then this method returns the absolute URI of the resource from which the document node was constructed. If the document URI is not available, then the empty string is returned. If the document URI is available, the returned value is the same as if fn:document-uri were evaluated on this document node. If the item is of a node kind other than document node, then the returned URI is implementation-defined.
+ * On a forward only sequence this method can be called independent of any other get or write method. It will not raise an error if such method has been called already, nor will it affect subsequent invocations of any other get or write method on the current item.
+ *
+ * @return the document URI for this document node or the empty string if not available. For other node kinds, the result is implementation-defined
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) the current item is not a node, (3) if the underlying sequence or item is in a closed state
+ */
@Override
public URI getNodeUri() throws XQException {
isClosedXQException();
return getItem().getNodeUri();
}
+ /** \brief Gets the current item as an Object.
+ *
+ * The data type of the returned object will be the Java Object type as specified in 14.4 Mapping an XQuery Atomic Value to a Java Object Type and 14.5 Mapping an XQuery Node to a Java Object Type, XQuery API for Java (XQJ) 1.0.
+ *
+ * @return an object representing the current item
+ * @throw XQException - if (1) if there are errors accessing the current item, (2) if the underlying sequence or item is in a closed state, or (3) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public Object getObject() throws XQException {
isClosedXQException();
return getItem().getObject();
}
+ /** \brief Read the current item as an XMLStreamReader object.
+ *
+ * Read the current item as an XMLStreamReader object, as described in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. While the stream is being read, the application MUST NOT do any other concurrent operations on the underlying item or sequence. The operation on the stream is undefined if the underlying sequence is repositioned or the state of the underlying item or sequence is changed by concurrent operations.
+ *
+ * @return an XML reader object as XMLStreamReader
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) in case of an error during serialization of the current item into a StAX event stream as defined in Section 12.1 Serializing an XDM instance into a StAX event stream (XMLStreamReader), XQuery API for Java (XQJ) 1.0
+ */
@Override
public XMLStreamReader getItemAsStream() throws XQException {
isClosedXQException();
return getItem().getItemAsStream();
}
+ /** \brief Serializes the current item according to the XSLT 2.0 and XQuery 1.0 serialization.
+ *
+ * Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @return the serialized representation of the item
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, or (4) if there are errors during serialization
+ */
@Override
public String getItemAsString(Properties prprts) throws XQException {
isClosedXQException();
return getItem().getItemAsString(prprts);
}
+ /** \brief Gets the current item as a short.
+ *
+ * The current item must be an atomic value of type xs:decimal or a subtype, and its value must be in the value space of short.
+ *
+ * @return a short representing the current item
+ * @throw XQException - if (1) the conversion of the current item to a short fails, (2) if there are errors accessing the current item, (3) if the underlying sequence or item is in a closed state, or (4) in the case of forward only sequences, a get or write method was already invoked on the current item
+ */
@Override
public short getShort() throws XQException {
isClosedXQException();
return getItem().getShort();
}
+ /** \brief Checks if the item "matches" an item type.
+ *
+ * Checks if the item "matches" an item type, as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language. You can use this method to first check the type of the result before calling the specific get methods.
+ *
+ * Example -
+ * \code{.java}
+ * ...
+ * XQItemType strType = conn.createAtomicType(XQItemType.XQBASETYPE_STRING);
+ * XQItemType nodeType = conn.createNodeType();
+ *
+ * XQSequence result = preparedExpr.executeQuery();
+ * while (result.next())
+ * {
+ * // Generic check for node..
+ * if (result.instanceOf(nodeType))
+ * org.w3.dom.Node node = result.getNode();
+ * else if (result.instanceOf(strType))
+ * String str = result.getAtomicValue();
+ * }
+ *
+ *
+ * If either the type of the XQItemAccessor or the input XQItemType is not a built-in type, then this method is allowed to raise exception if it can NOT determine the instanceOf relationship due to the lack of the access of the XML schema that defines the user defined schema types if the XQMetaData.isUserDefinedXMLSchemaTypeSupported() method returns false.
+ * Otherwise, this method must determine if the type of the XQItemAccessor is an instance of the input XQItemType. Note even if isUserDefinedXMLSchemaTypeSupported() returns false, an XQJ implementation may still be able to determine the instanceOf relationship for certain cases involving user defined schema type. For example, if the type of an XQItemAccessor is of mySchema:hatSize sequence type and the input parameter XQItemType is of item() sequence type, the return value for instanceOf relationship should always be true even though the XQJ implementation does not know the precise type information of mySchema:hatSize type defined in XML schema 'mySchema'.
+ * \endcode
+ * @param xqit - item type to match
+ * @return true if this item matches the input item type as defined in 2.5.4.2 Matching an Item Type and an Item, XQuery 1.0: An XML Query Language, and false if it does not
+ * @throw XQException - if (1) there are errors accessing the item's type, (2) if the underlying sequence or item is in a closed state, (3) if the implementation is unable to determine the schema definition of a user defined schema type, or (4) the type parameter is null
+ */
@Override
public boolean instanceOf(XQItemType xqit) throws XQException {
isClosedXQException();
@@ -468,6 +822,14 @@
return getItem().instanceOf(xqit);
}
+ /** \brief Serializes the current item to a Writer.
+ *
+ * Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * @param out - the output stream into which the current item is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null
+ */
@Override
public void writeItem(OutputStream out, Properties prprts) throws XQException {
isClosedXQException();
@@ -475,6 +837,15 @@
getItem().writeItem(out, prprts);
}
+ /** \brief Serializes the current item to a Writer.
+ *
+ * Serializes the current item to a Writer according to XSLT 2.0 and XQuery 1.0 serialization. Serialization parameters, which influence how serialization is performed, can be specified. Refer to the XSLT 2.0 and XQuery 1.0 serialization and Section 12 Serialization, XQuery API for Java (XQJ) 1.0 for more information.
+ *
+ * Warning: When outputting to a Writer, make sure the writer's encoding matches the encoding parameter if specified as a property or the default encoding.
+ * @param writer - the output stream into which the current item is to be serialized
+ * @param prprts - specifies the serialization parameters, null is considered equivalent to an empty Properties object
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) if there are errors during serialization, or (5) the os parameter is null
+ */
@Override
public void writeItem(Writer writer, Properties prprts) throws XQException {
isClosedXQException();
@@ -482,6 +853,13 @@
getItem().writeItem(writer, prprts);
}
+ /** \brief Writes the current item to a SAX handler.
+ *
+ * Writes the current item to a SAX handler, as described in in Section 12.2 Serializing an XDM instance into a SAX event stream, XQuery API for Java (XQJ) 1.0. Note that the serialization process might fail, in which case a XQException is thrown. The specified org.xml.sax.ContentHandler can optionally implement the org.xml.sax.LexicalHandler interface. An implementation must check if the specified ContentHandler implements LexicalHandler. If the handler is a LexicalHandler comment nodes are reported, otherwise they will be silently ignored.
+ *
+ * @param saxhdlr - the SAX content handler, optionally a lexical handler
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the XDM instance into a SAX event stream, or (5) the saxhdlr parameter is null
+ */
@Override
public void writeItemToSAX(ContentHandler ch) throws XQException {
isClosedXQException();
@@ -489,6 +867,17 @@
getItem().writeItemToSAX(ch);
}
+ /** \brief Writes the current item to a Result.
+ *
+ * First the item is normalized as described in XSLT 2.0 and XQuery 1.0 serialization. Subsequently it is serialized to the Result object.
+ * Note that the normalization process can fail, in which case an XQException is thrown. An XQJ implementation must at least support the following implementations:
+ * - javax.xml.transform.dom.DOMResult
+ * - javax.xml.transform.sax.SAXResult
+ * - javax.xml.transform.stream.StreamResult
+ *
+ * @param result - the result object into which the item is to be serialized
+ * @throw XQException - if (1) there are errors accessing the current item or the underlying sequence, (2) the underlying sequence or item is in a closed state, (3) in the case of a forward only sequence, a get or write method has already been invoked on the current item, (4) in case of an error while serializing the current item into the Result object, or (5) the result parameter is null
+ */
@Override
public void writeItemToResult(Result result) throws XQException {
isClosedXQException();
=== modified file 'swig/xqj/XQSequenceType.java'
--- swig/xqj/XQSequenceType.java 2012-04-19 23:07:13 +0000
+++ swig/xqj/XQSequenceType.java 2012-05-14 18:27:25 +0000
@@ -17,27 +17,51 @@
import javax.xml.xquery.XQItemType;
-
+ /**
+ * The XQSequenceType interface represents a sequence type as XQuery 1.0: An XML Query language. The XQSequenceType is the base interface for the XQItemType interface and contains an occurence indicator.
+ *
+ */
public class XQSequenceType implements javax.xml.xquery.XQSequenceType {
XQItemType type;
int occurence;
-
+
public XQSequenceType(XQItemType type, int occurence) {
this.type = type;
this.occurence = occurence;
}
-
+
+ /** \brief Returns the type of the item in the sequence type.
+ *
+ * @return XQItemType representing the item type in the sequence. null is returned in case of an empty sequence.
+ */
@Override
public XQItemType getItemType() {
return type;
}
+ /** \brief Returns the occurrence indicator for the sequence type.
+ *
+ * One of:
+ *
+ * Description Value
+ * Zero or one OCC_ZERO_OR_ONE
+ * Exactly one OCC_EXACTLY_ONE
+ * Zero or more OCC_ZERO_OR_MORE
+ * One or more OCC_ONE_OR_MORE
+ * Empty OCC_EMPTY
+ *
+ * @return int indicating the occurrence indicator
+ */
@Override
public int getItemOccurrence() {
return occurence;
}
-
+
+ /** \brief Returns a human-readable implementation-defined string representation of the sequence type.
+ *
+ * @return a String representation of the sequence type
+ */
@Override
public String toString() {
StringBuffer result = new StringBuffer();
@@ -60,6 +84,17 @@
return result.toString();
}
+ /** \brief Compares the specified object with this sequence type for equality.
+ *
+ * The result is true only if the argument is a sequence type object which represents the same XQuery sequence type.
+ *
+ * In order to comply with the general contract of equals and hashCode across different implementations the following algorithm must be used. Return true if and only if both objects are XQsequenceType and:
+ * - getItemOccurrence() is equal
+ * - if not OCC_EMPTY, getItemType() is equal
+ *
+ * @param o - an XQItemType object representing an XQuery sequence type
+ * @return true if the input item type object represents the same XQuery sequence type, false otherwise
+ */
@Override
public boolean equals(Object o) {
boolean result = false;
@@ -71,6 +106,23 @@
return result;
}
+ /** \brief Returns a hash code consistent with the definition of the equals method.
+ *
+ * In order to comply with the general contract of equals and hashCode across different implementations the following algorithm must be used:
+ * \code{.java}
+ * int hashCode;
+ * if (getItemOccurrence() == XQSequenceType.OCC_EMPTY)
+ * {
+ * hashCode = 1;
+ * }
+ * else
+ * {
+ * hashCode = getItemOccurrence()*31 + getItemType().hashCode();
+ * }
+ * \endcode
+ *
+ * @return hash code for this item type
+ */
@Override
public int hashCode() {
int hashCode;
=== modified file 'swig/xqj/XQStaticCollectionManager.java'
--- swig/xqj/XQStaticCollectionManager.java 2012-04-21 15:47:08 +0000
+++ swig/xqj/XQStaticCollectionManager.java 2012-05-14 18:27:25 +0000
@@ -23,6 +23,11 @@
import org.zorbaxquery.api.StaticCollectionManager;
+ /**
+ * Using the XQStaticCollectionManager one can retrieve information about statically declared collections and indexes as well as manage them.
+ *
+ * The XQStaticCollectionManager can be retrieved from (1) a compiled XQuery or (2) a XQStaticContext object. In both cases, this class provides access to information for the collections and indexes that are declared in (1) all the modules (transitively) imported by the main query or (2) the module that resulted in the compilation of the StaticContext, respectively. Moreover, this class allows to create or delete such collections and indexes.
+ */
public class XQStaticCollectionManager {
private boolean closed = false;
@@ -48,6 +53,12 @@
return closed;
}
+ /** \brief This function returns a sequence of names of the collections that are available.
+ *
+ * If this is an instance of the StaticCollectionManager class (i.e. returned by any of the getStaticCollectionManager methods), the collections returned by this function are also statically declared.
+ *
+ * @return XQSequence - The list of names of the available collections.
+ */
public XQSequence availableCollections() throws XQException {
isClosedXQException();
XQSequence result = new org.zorbaxquery.api.xqj.XQSequence(collectionManager.availableCollections());
@@ -55,16 +66,32 @@
return result;
}
+ /** \brief This function creates the collection with the given name.
+ *
+ * @param aName The name of the collection to create.
+ * @throw XQException- if a collection with the given name already exists.
+ */
public void createCollection(XQItem aName ) throws XQException {
isClosedXQException();
collectionManager.createCollection(((org.zorbaxquery.api.xqj.XQItem)aName).getZorbaItem());
}
+ /** \brief This function removes the collection with the given name.
+ *
+ * @param aName - The name of the collection to delete.
+ * @throw XQException - if the collection does not exist.
+ */
public void deleteCollection(XQItem aName ) throws XQException {
isClosedXQException();
collectionManager.deleteCollection(((org.zorbaxquery.api.xqj.XQItem)aName).getZorbaItem());
}
+ /** \brief Returns a instance of the Collection class which can be used to modify and retrieve the contents of the collection identified by the given name.
+ *
+ * @param aName - The name of the collection to retrieve.
+ * @return XQCollection - The collection if available.
+ * @throw XQException - if the collection does not exist.
+ */
public XQCollection getCollection(XQItem aName ) throws XQException {
isClosedXQException();
XQCollection result = new XQCollection ( collectionManager.getCollection(((org.zorbaxquery.api.xqj.XQItem)aName).getZorbaItem()) );
@@ -72,6 +99,14 @@
return result;
}
+ /** \brief This function returns true if a collection with the given name is available.
+ *
+ * If this is an instance of the StaticCollectionManager class (i.e. returned by any of the getStaticCollectionManager() methods), the collection also needs to be statically declared.
+ *
+ * @param aName - The name of the collection that is being checked.
+ * @return true if the collection is available and false otherwise.
+ * @throw XQException - if the Collection Manager is closed
+ */
public boolean isAvailableCollection(XQItem aName ) throws XQException {
isClosedXQException();
return collectionManager.isAvailableCollection( ((org.zorbaxquery.api.xqj.XQItem)aName).getZorbaItem() );
=== modified file 'swig/xqj/XQStaticContext.java'
--- swig/xqj/XQStaticContext.java 2012-05-03 12:31:51 +0000
+++ swig/xqj/XQStaticContext.java 2012-05-14 18:27:25 +0000
@@ -35,6 +35,53 @@
import org.zorbaxquery.api.ZorbaConstants.OrderingMode;
import org.zorbaxquery.api.ZorbaConstants.PreserveMode;
+ /** \brief
+ *
+ * An XQStaticContext represents default values for various XQuery Static Context Components. Further it includes the static XQJ properties for an XQExpression or XQPreparedExpression object.
+ *
+ * The following XQuery Static Context Components are supported through the XQStaticContext interface:
+ *
+ * - Statically known namespaces
+ * - Default element/type namespace
+ * - Default function namespace
+ * - Context item static type
+ * - Default collation
+ * - Construction mode
+ * - Ordering mode
+ * - Default order for empty sequences
+ * - Boundary-space policy
+ * - Copy-namespaces mode
+ * - Base URI
+ *
+ * As described in the XQuery specification, each of these default values can be overridden or augmented in the query prolog.
+ * In addition XQStaticContext includes the static XQJ properties for an XQExpression or XQPreparedExpression object:
+ *
+ * - Binding mode
+ * - Holdability of the result sequences
+ * - Scrollability of the result sequences
+ * - Query language
+ * - Query timeout
+ *
+ * Note that XQStaticContext is a value object, changing attributes in such object doesn't affect any existing XQExpression or XQPreparedExpression object.
+ * In order to take effect, the application needs to explicitly change the XQConnection default values, or specify an XQStaticContext object when creating an XQExpression or XQPreparedExpression.
+ * \code{.java}
+ * XQConnection conn = XQDatasource.getConnection();
+ * // get the default values from the implementation
+ * XQStaticContext cntxt = conn.getStaticContext();
+ * // change the base uri
+ * cntxt.setBaseURI("http://www.foo.com/xml/");
+ * // change the implementation defaults
+ * conn.setStaticContext(cntxt);
+ *
+ * // create an XQExpression using the new defaults
+ * XQExpression expr1 = conn.createExpression();
+ *
+ * // creat an XQExpression, using BaseURI "file:///root/user/john/"
+ * cntxt.setBaseURI("file:///root/user/john/");
+ * XQExpression expr2 = conn.createExpression(cntxt);
+ * ...
+ * \endcode
+ */
public class XQStaticContext implements javax.xml.xquery.XQStaticContext {
@@ -91,7 +138,12 @@
staticContext.setModulePath(modulePaths);
}
}
-
+
+ /** \brief Returns the prefixes of all the statically known namespaces.
+ * Use the getNamespaceURI method to look up the namespace URI corresponding to a specific prefix.
+ *
+ * @return String array containing the namespace prefixes. Cannot be null
+ */
@Override
public String[] getNamespacePrefixes() {
@@ -105,6 +157,13 @@
return stringBindings.toArray(new String[0]);
}
+ /** \brief Retrieves the namespace URI associated with a prefix.
+ * An XQException is thrown if an unknown prefix is specified, i.e. a prefix not returned by the getInScopeNamespacePrefixes method.
+ *
+ * @param prefix - the prefix for which the namespace URI is sought. Cannot be null
+ * @return the namespace URI. Cannot be null
+ * @throw XQException - if a null prefix is specified or if the prefix is unknown
+ */
@Override
public String getNamespaceURI(String prefix) throws XQException {
isNullXQException(prefix);
@@ -117,6 +176,13 @@
return result;
}
+ /** \brief Declares a namespace prefix and associates it with a namespace URI.
+ * If the namespace URI is the empty string, the prefix is removed from the in-scope namespace definitions.
+ *
+ * @param prefix - the prefix for the namespace URI
+ * @param URI - the namespace URI. An empty string undeclares the specific prefix. Cannot be null
+ * @throw XQException - if (1) a null prefix, or (2) a null namespace URI is specified
+ */
@Override
public void declareNamespace(String prefix, String URI) throws XQException {
isNullXQException(prefix);
@@ -156,28 +222,50 @@
}
}
+ /** \brief Gets the URI of the default element/type namespace, the empty string if not set.
+ *
+ * @return the URI of the default element/type namespace, if set, else the empty string. Cannot be null
+ */
@Override
public String getDefaultElementTypeNamespace() {
return staticContext.getDefaultElementAndTypeNamespace();
}
+ /** \brief Sets the URI of the default element/type namespace, the empty string to make it unspecified.
+ *
+ * @param URI - the namespace URI of the default element/type namespace, the empty string to make it unspecified. Cannot be null.
+ * @throw XQException - if a null uri is specified
+ */
@Override
public void setDefaultElementTypeNamespace(String URI) throws XQException {
isNullXQException(URI);
staticContext.setDefaultElementAndTypeNamespace(URI);
}
+ /** \brief Gets the URI of the default function namespace, the empty string if not set.
+ *
+ * @return the URI of the default function namespace, if set, else the empty string. Cannot be null
+ */
@Override
public String getDefaultFunctionNamespace() {
return staticContext.getDefaultFunctionNamespace();
}
+ /** \brief Sets the URI of the default function namespace, the empty string to make it unspecified.
+ *
+ * @param URI - the namespace URI of the default function namespace, the empty string to make it unspecified. Cannot be null.
+ * @throw XQException - if a null URI is specified
+ */
@Override
public void setDefaultFunctionNamespace(String URI) throws XQException {
isNullXQException(URI);
staticContext.setDefaultFunctionNamespace(URI);
}
+ /** \brief Gets the static type of the context item. null if unspecified.
+ *
+ * @return the static type of the context item, if set, else null
+ */
@Override
public XQItemType getContextItemStaticType() {
//not very complete implementation
@@ -185,6 +273,11 @@
return contextItemStaticType;
}
+ /** \brief Sets the static type of the context item, specify null to make it unspecified.
+ *
+ * @param xqit - the static type of the context item; null if unspecified.
+ * @throw XQException - if the contextItemType is not a valid XQItemType
+ */
@Override
public void setContextItemStaticType(XQItemType xqit) throws XQException {
contextItemStaticType = xqit;
@@ -194,17 +287,30 @@
}
}
+ /** \brief Gets the URI of the default collation.
+ *
+ * @return the URI of the default collation. Cannot be null.
+ */
@Override
public String getDefaultCollation() {
return staticContext.getDefaultCollation();
}
+ /** \brief Sets the URI of the default collation.
+ *
+ * @param URI - the namespace URI of the default collation. Cannot be null.
+ * @throw XQException - if a null URI is specified
+ */
@Override
public void setDefaultCollation(String URI) throws XQException {
isNullXQException(URI);
staticContext.setDefaultCollation(URI);
}
+ /** \brief Gets the construction mode defined in the static context.
+ *
+ * @return construction mode value. One of: XQConstants.CONSTRUCTION_MODE_PRESERVE, XQConstants.CONSTRUCTION_MODE_STRIP
+ */
@Override
public int getConstructionMode() {
int result = XQConstants.CONSTRUCTION_MODE_PRESERVE;
@@ -215,6 +321,11 @@
return result;
}
+ /** \brief Sets the construction mode in the static context.
+ *
+ * @param i - construction mode value. One of: XQConstants.CONSTRUCTION_MODE_PRESERVE, XQConstants.CONSTRUCTION_MODE_STRIP.
+ * @throw XQException - the specified mode is different from XQConstants.CONSTRUCTION_MODE_PRESERVE, XQConstants.CONSTRUCTION_MODE_STRIP
+ */
@Override
public void setConstructionMode(int i) throws XQException {
if (!((i==XQConstants.CONSTRUCTION_MODE_PRESERVE) || (i==XQConstants.CONSTRUCTION_MODE_STRIP))) {
@@ -227,6 +338,10 @@
staticContext.setConstructionMode(mode);
}
+ /** \brief Gets the ordering mode defined in the static context.
+ *
+ * @return ordering mode value. One of: XQConstants.ORDERING_MODE_ORDERED, XQConstants.ORDERING_MODE_UNORDERED.
+ */
@Override
public int getOrderingMode() {
int result = XQConstants.ORDERING_MODE_ORDERED;
@@ -237,6 +352,11 @@
return result;
}
+ /** \brief Sets the ordering mode in the static context.
+ *
+ * @param i - ordering mode value. One of: XQConstants.ORDERING_MODE_ORDERED, XQConstants.ORDERING_MODE_UNORDERED.
+ * @throw XQException - the specified mode is different from XQConstants.ORDERING_MODE_ORDERED, XQConstants.ORDERING_MODE_UNORDERED
+ */
@Override
public void setOrderingMode(int i) throws XQException {
if (!((i==XQConstants.ORDERING_MODE_ORDERED) || (i==XQConstants.ORDERING_MODE_UNORDERED))) {
@@ -249,6 +369,10 @@
staticContext.setOrderingMode(mode);
}
+ /** \brief Gets the default order for empty sequences defined in the static context.
+ *
+ * @return default order for empty sequences value. One of: XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST, XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST.
+ */
@Override
public int getDefaultOrderForEmptySequences() {
int result = XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST;
@@ -259,6 +383,11 @@
return result;
}
+ /** \brief Sets the default order for empty sequences in the static context.
+ *
+ * @param i - the default order for empty sequences. One of: XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST, XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST.
+ * @throw XQException - the specified order for empty sequences is different from XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST, XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST
+ */
@Override
public void setDefaultOrderForEmptySequences(int i) throws XQException {
if (!((i == XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST) || (i==XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST))) {
@@ -271,6 +400,10 @@
staticContext.setDefaultOrderForEmptySequences(result);
}
+ /** \brief Gets the boundary-space policy defined in the static context.
+ *
+ * @return the boundary-space policy value. One of: XQConstants.BOUNDARY_SPACE_PRESERVE, XQConstants.BOUNDARY_SPACE_STRIP.
+ */
@Override
public int getBoundarySpacePolicy() {
int result = XQConstants.BOUNDARY_SPACE_PRESERVE;
@@ -281,6 +414,11 @@
return result;
}
+ /** \brief Sets the boundary-space policy in the static context.
+ *
+ * @param i - boundary space policy. One of: XQConstants.BOUNDARY_SPACE_PRESERVE, XQConstants.BOUNDARY_SPACE_STRIP.
+ * @throw XQException - the specified mode is different from XQConstants.BOUNDARY_SPACE_PRESERVE, XQConstants.BOUNDARY_SPACE_STRIP
+ */
@Override
public void setBoundarySpacePolicy(int i) throws XQException {
if (!((i == XQConstants.BOUNDARY_SPACE_PRESERVE) || (i==XQConstants.BOUNDARY_SPACE_STRIP))) {
@@ -293,6 +431,10 @@
staticContext.setBoundarySpacePolicy(result);
}
+ /** \brief Gets the preserve part of the copy-namespaces mode defined in the static context.
+ *
+ * @return construction mode value. One of: XQConstants.COPY_NAMESPACES_MODE_PRESERVE, XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE.
+ */
@Override
public int getCopyNamespacesModePreserve() {
int result = XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE;
@@ -303,6 +445,11 @@
return result;
}
+ /** \brief Sets the preserve part of the copy-namespaces mode in the static context.
+ *
+ * @param i - ordering mode value. One of: XQConstants.COPY_NAMESPACES_MODE_PRESERVE, XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE.
+ * @throw XQException - the specified mode is different from XQConstants.COPY_NAMESPACES_MODE_PRESERVE, XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE
+ */
@Override
public void setCopyNamespacesModePreserve(int i) throws XQException {
if (!((i==XQConstants.COPY_NAMESPACES_MODE_PRESERVE) || (i==XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE))) {
@@ -316,6 +463,10 @@
staticContext.setCopyNamespacesMode(preserve, inherit);
}
+ /** \brief Gets the inherit part of the copy-namespaces mode defined in the static context.
+ *
+ * @return construction mode value. One of: XQConstants.COPY_NAMESPACES_MODE_INHERIT, XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT.
+ */
@Override
public int getCopyNamespacesModeInherit() {
int result = XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT;
@@ -326,6 +477,11 @@
return result;
}
+ /** \brief Sets the inherit part of the copy-namespaces mode in the static context.
+ *
+ * @param i - ordering mode value. One of: XQConstants.COPY_NAMESPACES_MODE_INHERIT, XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT.
+ * @throw XQException - the specified mode is different from XQConstants.COPY_NAMESPACES_MODE_INHERIT, XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT
+ */
@Override
public void setCopyNamespacesModeInherit(int i) throws XQException {
if (!((i==XQConstants.COPY_NAMESPACES_MODE_INHERIT) || (i==XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT))) {
@@ -339,6 +495,10 @@
staticContext.setCopyNamespacesMode(preserve, inherit);
}
+ /** \brief Gets the Base URI, if set in the static context, else the empty string.
+ *
+ * @return the base URI, if set, else the empty string. Cannot be null..
+ */
@Override
public String getBaseURI() {
if (baseURI==null) {
@@ -348,6 +508,11 @@
}
}
+ /** \brief Sets the Base URI in the static context, specify the empty string to make it undefined.
+ *
+ * @param URI - the new baseUri, or empty string to make it undefined. Cannot be null.
+ * @throw XQException - if a null base uri is specified
+ */
@Override
public void setBaseURI(String URI) throws XQException {
isNullXQException(URI);
@@ -355,11 +520,22 @@
baseURI = URI;
}
+ /** \brief Gets the value of the binding mode property.
+ * By default an XQJ implementation operates in immediate binding mode.
+ *
+ * @return the binding mode. One of XQConstants.BINDING_MODE_IMMEDIATE, orXQConstants.BINDING_MODE_DEFERRED.
+ */
@Override
public int getBindingMode() {
return binding;
}
+ /** \brief Sets the binding mode property.
+ * By default an XQJ implementation operates in immediate binding mode.
+ *
+ * @param i - the binding mode. One of: XQConstants.BINDING_MODE_IMMEDIATE, orXQConstants.BINDING_MODE_DEFERRED.
+ * @throw XQException - the specified mode is different from XQConstants.BINDING_MODE_IMMEDIATE, XQConstants.BINDING_MODE_DEFERRED
+ */
@Override
public void setBindingMode(int i) throws XQException {
if (!((i==XQConstants.BINDING_MODE_DEFERRED) || (i==XQConstants.BINDING_MODE_IMMEDIATE))) {
@@ -368,11 +544,20 @@
binding = i;
}
+ /** \brief Gets the value of the holdability property.
+ *
+ * @return the type of a result's holdability. One of: XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, or XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.
+ */
@Override
public int getHoldability() {
return holdability;
}
+ /** \brief Sets the holdability property.
+ *
+ * @param i - the holdability of the result. One of: XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, or XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.
+ * @throw XQException - the specified holdability is different from XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT
+ */
@Override
public void setHoldability(int i) throws XQException {
if (!((i==XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT) || (i==XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT))) {
@@ -381,11 +566,22 @@
holdability = i;
}
+ /** \brief Gets the value of the language type and version property.
+ * By default an XQJ implementation's default is XQConstants.LANGTYPE_XQUERY.
+ *
+ * @return the language type and version. One of: XQConstants.LANGTYPE_XQUERY, or XQConstants.LANGTYPE_XQUERYX or a negative value indicating a vendor specific query language type and version.
+ */
@Override
public int getQueryLanguageTypeAndVersion() {
return queryLang;
}
+ /** \brief Sets the input query language type and version.
+ * When this is set to a particular language type and version, then the query is assumed to be in that language and version.
+ *
+ * @param i - the query language type and version of the inputs. One of: XQConstants.LANGTYPE_XQUERY (default), or XQConstants.LANGTYPE_XQUERYX. A negative number indicates a vendor specific query language type and version.
+ * @throw XQException - the specified langtype is different from XQConstants.LANGTYPE_XQUERY, XQConstants.LANGTYPE_XQUERYX and is not negative
+ */
@Override
public void setQueryLanguageTypeAndVersion(int i) throws XQException {
if (!((i==XQConstants.LANGTYPE_XQUERY) || (i==XQConstants.LANGTYPE_XQUERYX))) {
@@ -394,11 +590,22 @@
queryLang = i;
}
+ /** \brief Gets the value of the scrollability property.
+ * By default query results are forward only.
+ *
+ * @return the type of a result's scrollability. One of: XQConstants.SCROLLTYPE_FORWARD_ONLY, or XQConstants.SCROLLTYPE_SCROLLABLE.
+ */
@Override
public int getScrollability() {
return scrollability;
}
+ /** \brief Sets the scrollability of the result sequence.
+ * By default query results are forward only.
+ *
+ * @param i - the scrollability of the result. One of: XQConstants.SCROLLTYPE_FORWARD_ONLY, or XQConstants.SCROLLTYPE_SCROLLABLE.
+ * @throw XQException - the specified crollability type is different from XQConstants.SCROLLTYPE_FORWARD_ONLY, XQConstants.SCROLLTYPE_SCROLLABLE
+ */
@Override
public void setScrollability(int i) throws XQException {
if (!((i==XQConstants.SCROLLTYPE_FORWARD_ONLY) || (i==XQConstants.SCROLLTYPE_SCROLLABLE))) {
@@ -407,11 +614,21 @@
scrollability = i;
}
+ /** \brief Retrieves the number of seconds an implementation will wait for a query to execute.
+ *
+ * @return the query execution timeout value in seconds. A value of 0 indicates no limit.
+ */
@Override
public int getQueryTimeout() {
return 0;
}
+ /** \brief Sets the number of seconds an implementation will wait for a query to execute.
+ * If the implementation does not support query timeout it can ignore the specified timeout value. It the limit is exceeded, the behavor of the query is the same as an execution of a cancel by another thread.
+ *
+ * @param i - the query execution timeout value in seconds. A value of 0 indicates no limit
+ * @throw XQException - if the passed in value is negative
+ */
@Override
public void setQueryTimeout(int i) throws XQException {
if (i<0) {
@@ -419,6 +636,14 @@
}
}
+ /** \brief Returns a StaticCollectionManager.
+ *
+ * Returns a CollectionManager responsible for all collections which are statically declared in the static context of this query (main module) or any transitively imported library module.
+ * The collection manager provides a set of functions for managing collections and their contents.
+ *
+ * @return XQStaticCollectionManager The collection manager responsible for managing collections of this Sequence.
+ * @throw XQException - if the object is closed
+ */
public XQStaticCollectionManager getStaticCollectionManager() throws XQException {
if (lStaticCollectionManager==null) {
lStaticCollectionManager = new XQStaticCollectionManager(staticContext.getStaticCollectionManager());
=== modified file 'swig/xqj/XQXmlDataManager.java'
--- swig/xqj/XQXmlDataManager.java 2012-04-28 05:52:32 +0000
+++ swig/xqj/XQXmlDataManager.java 2012-05-14 18:27:25 +0000
@@ -23,6 +23,12 @@
import org.zorbaxquery.api.Zorba;
+ /**
+ * Using the XQXmlDataManager one can manage documents and collections.
+ *
+ * The XQXmlDataManager is a singleton instance. The XQConnection object is reponsible for maintaining its lifetime. The instance can be accessed by calling getXmlDataManager() on the XQConnection object. It may not be accessed anymore after XQConnection is closed.
+ *
+ */
public class XQXmlDataManager {
private boolean closed = false;
@@ -36,6 +42,12 @@
dm = zorba.getXmlDataManager();
}
+ /** \brief Close the XmlDataManager and release all the resources associated with this item.
+ *
+ * Close the XmlDataManager and release all the resources associated with this item. No method other than the isClosed or close method may be called once the XmlDataManager is closed. Calling close on an XmlDataManager object that is already closed has no effect.
+ *
+ * @throw XQException - if there is an error during closing the item
+ */
public void close() throws XQException {
if (lDocumentManager!=null) {
lDocumentManager.close();
@@ -55,10 +67,16 @@
closed = true;
}
+ /** \brief Checks if the XQXmlDataManager is closed.
+ *
+ * Checks if the XQXmlDataManager is closed.
+ *
+ * @return boolean true if the XQXmlDataManager is in a closed state, false otherwise
+ */
public boolean isClosed() {
return closed;
}
-
+
public XQDocumentManager getDocumentManager() throws XQException {
isClosedXQException();
if (lDocumentManager==null) {
@@ -66,7 +84,14 @@
}
return lDocumentManager;
}
-
+
+ /** \brief Returns a CollectionManager responsible for all collections.
+ * The collection manager provides a set of functions for managing collections identified by a QName and their contents.
+ *
+ * Please note that the resulting manager is only responsible for dynamic collections identified by a QName, i.e. those that are not declared in the prolog of a module or identified by a URI.
+ *
+ * @return The collection manager responsible for managing collections.
+ */
public XQCollectionManager getCollectionManager() throws XQException {
isClosedXQException();
if (lCollectionManager==null) {
@@ -74,7 +99,14 @@
}
return lCollectionManager;
}
-
+
+ /** \brief Returns a CollectionManager responsible for collections identified by a URI.
+ * The collection manager provides a set of functions for managing collections identified by a URI and their contents.
+ *
+ * Please note that the resulting manager is only responsible for dynamic collections identified by a URI, i.e. those that are not declared in the prolog of a module or identified by a QName.
+ *
+ * @return The collection manager responsible for managing collections.
+ */
public XQCollectionManager getW3CCollectionManager() throws XQException {
isClosedXQException();
if (lW3CollectionManager==null) {
@@ -82,7 +114,10 @@
}
return lW3CollectionManager;
}
-
+
+ /** \brief Parse an XML document and return an XQSequence.
+ *
+ */
public XQSequence parseXML(String xmlText) throws XQException {
isClosedXQException();
ItemSequence zSequence = new ItemSequence(dm.parseXMLtoItem(xmlText));
@@ -90,7 +125,7 @@
sequences.add(result);
return result;
}
-
+
private void isClosedXQException() throws XQException {
if (closed) {
throw new XQException("XmlDataManager is closed");
Follow ups
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: noreply, 2012-05-15
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Zorba Build Bot, 2012-05-15
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Zorba Build Bot, 2012-05-15
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Matthias Brantner, 2012-05-15
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Matthias Brantner, 2012-05-15
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Rodolfo Ochoa, 2012-05-15
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Matthias Brantner, 2012-05-15
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Zorba Build Bot, 2012-05-14
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Zorba Build Bot, 2012-05-14
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Zorba Build Bot, 2012-05-14
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Zorba Build Bot, 2012-05-14
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Cezar Andrei, 2012-05-14
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Cezar Andrei, 2012-05-14
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Rodolfo Ochoa, 2012-05-14
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Cezar Andrei, 2012-05-14
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Cezar Andrei, 2012-05-14
-
Re: [Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: William Candillon, 2012-05-14
-
[Merge] lp:~zorba-coders/zorba/xqjdoc into lp:zorba
From: Rodolfo Ochoa, 2012-05-14