net.sf.saxon.xqj
Class SaxonXQDataFactory

java.lang.Object
  extended by net.sf.saxon.xqj.Closable
      extended by net.sf.saxon.xqj.SaxonXQDataFactory
All Implemented Interfaces:
javax.xml.xquery.XQDataFactory
Direct Known Subclasses:
SaxonXQConnection

public abstract class SaxonXQDataFactory
extends Closable
implements javax.xml.xquery.XQDataFactory

Saxon implementation of the XQJ interface XQDataFactory. This is an abstract superclass for SaxonXQDataSource and SaxonXQConnection, both of which provide the factory methods in this interface.

For Javadoc specifications of the public methods in this class, see the XQJ documentation.


Constructor Summary
SaxonXQDataFactory()
           
 
Method Summary
 javax.xml.xquery.XQItemType createAtomicType(int baseType)
          Create an atomic item type object representing a particular built-in atomic type
 javax.xml.xquery.XQItemType createAtomicType(int baseType, javax.xml.namespace.QName typename, java.net.URI schemaURI)
          See interface definition, and description of Saxon extensions below.
 javax.xml.xquery.XQItemType createAttributeType(javax.xml.namespace.QName nodename, int basetype)
           
 javax.xml.xquery.XQItemType createAttributeType(javax.xml.namespace.QName nodename, int basetype, javax.xml.namespace.QName typename, java.net.URI schemaURI)
           
 javax.xml.xquery.XQItemType createCommentType()
           
 javax.xml.xquery.XQItemType createDocumentElementType(javax.xml.xquery.XQItemType elementType)
           
 javax.xml.xquery.XQItemType createDocumentSchemaElementType(javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItemType createDocumentType()
           
 javax.xml.xquery.XQItemType createElementType(javax.xml.namespace.QName nodename, int basetype)
           
 javax.xml.xquery.XQItemType createElementType(javax.xml.namespace.QName nodename, int basetype, javax.xml.namespace.QName typename, java.net.URI schemaURI, boolean allowNill)
           
 javax.xml.xquery.XQItem createItem(javax.xml.xquery.XQItem item)
           
 javax.xml.xquery.XQItem createItemFromAtomicValue(java.lang.String value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromBoolean(boolean value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromByte(byte value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromDocument(java.io.InputStream value, java.lang.String baseURI, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromDocument(java.io.Reader value, java.lang.String baseURI, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromDocument(javax.xml.transform.Source value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromDocument(java.lang.String value, java.lang.String baseURI, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromDocument(org.xml.sax.XMLReader value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromDocument(javax.xml.stream.XMLStreamReader value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromDouble(double value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromFloat(float value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromInt(int value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromLong(long value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromNode(org.w3c.dom.Node value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromObject(java.lang.Object value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromShort(short value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItem createItemFromString(java.lang.String value, javax.xml.xquery.XQItemType type)
           
 javax.xml.xquery.XQItemType createItemType()
           
 javax.xml.xquery.XQItemType createNodeType()
           
 javax.xml.xquery.XQItemType createProcessingInstructionType(java.lang.String piTarget)
           
 javax.xml.xquery.XQItemType createSchemaAttributeType(javax.xml.namespace.QName nodename, int basetype, java.net.URI schemaURI)
           
 javax.xml.xquery.XQItemType createSchemaElementType(javax.xml.namespace.QName nodename, int basetype, java.net.URI schemaURI)
           
 javax.xml.xquery.XQSequence createSequence(java.util.Iterator i)
           
 javax.xml.xquery.XQSequence createSequence(javax.xml.xquery.XQSequence s)
           
 javax.xml.xquery.XQSequenceType createSequenceType(javax.xml.xquery.XQItemType item, int occurrence)
           
 javax.xml.xquery.XQItemType createTextType()
           
(package private) abstract  Configuration getConfiguration()
           
 ObjectConverter getObjectConverter()
          Get the ObjectConverter in use.
protected  void init()
           
(package private) static int mapSaxonTypeToXQJ(int type)
          Get the XQJ type code corresponding to a given Saxon type code
 void setObjectConverter(ObjectConverter converter)
          Set the ObjectConverter to be used.
 
Methods inherited from class net.sf.saxon.xqj.Closable
checkNotClosed, close, isClosed, setClosableContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaxonXQDataFactory

public SaxonXQDataFactory()
Method Detail

getConfiguration

abstract Configuration getConfiguration()

mapSaxonTypeToXQJ

static int mapSaxonTypeToXQJ(int type)
Get the XQJ type code corresponding to a given Saxon type code

Parameters:
type - the Saxon type code
Returns:
the corresponding XQJ type code

init

protected void init()

setObjectConverter

public void setObjectConverter(ObjectConverter converter)
Set the ObjectConverter to be used. This allows user-defined object conversions to override or supplement the standard conversions

Parameters:
converter - the user-supplied ObjectConverter

getObjectConverter

public ObjectConverter getObjectConverter()
Get the ObjectConverter in use. This will either be the default object converter supplied by Saxon, or a user-supplied ObjectConverter if one has been set.

Returns:
the ObjectConverter in use.

createAtomicType

public javax.xml.xquery.XQItemType createAtomicType(int baseType)
                                             throws javax.xml.xquery.XQException
Create an atomic item type object representing a particular built-in atomic type

Specified by:
createAtomicType in interface javax.xml.xquery.XQDataFactory
Parameters:
baseType - the built-in atomic type, typically a constant such as XQItemType.XQBASETYPE_BOOLEAN
Returns:
the corresponding XQItemType
Throws:
javax.xml.xquery.XQException - if the supplied baseType parameter is not an atomic type

createAtomicType

public javax.xml.xquery.XQItemType createAtomicType(int baseType,
                                                    javax.xml.namespace.QName typename,
                                                    java.net.URI schemaURI)
                                             throws javax.xml.xquery.XQException
See interface definition, and description of Saxon extensions below.

In addition to the actions described in the XQJ interface definitions, Saxon allows the typename to be a name representing a Java external type. In this case the URI part of the QName must be NamespaceConstant.JAVA_TYPE, and the local part of the name must be the Java class name (qualified with its package name)

Specified by:
createAtomicType in interface javax.xml.xquery.XQDataFactory
Parameters:
baseType - the "baseType" (in XQJ terminology)
typename - the qualified name of the type
schemaURI - the location of a schema document in which the type is defined (may be null)
Returns:
the item type definition
Throws:
javax.xml.xquery.XQException

createAttributeType

public javax.xml.xquery.XQItemType createAttributeType(javax.xml.namespace.QName nodename,
                                                       int basetype)
                                                throws javax.xml.xquery.XQException
Specified by:
createAttributeType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createAttributeType

public javax.xml.xquery.XQItemType createAttributeType(javax.xml.namespace.QName nodename,
                                                       int basetype,
                                                       javax.xml.namespace.QName typename,
                                                       java.net.URI schemaURI)
                                                throws javax.xml.xquery.XQException
Specified by:
createAttributeType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createCommentType

public javax.xml.xquery.XQItemType createCommentType()
                                              throws javax.xml.xquery.XQException
Specified by:
createCommentType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createDocumentElementType

public javax.xml.xquery.XQItemType createDocumentElementType(javax.xml.xquery.XQItemType elementType)
                                                      throws javax.xml.xquery.XQException
Specified by:
createDocumentElementType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createDocumentSchemaElementType

public javax.xml.xquery.XQItemType createDocumentSchemaElementType(javax.xml.xquery.XQItemType type)
                                                            throws javax.xml.xquery.XQException
Specified by:
createDocumentSchemaElementType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createDocumentType

public javax.xml.xquery.XQItemType createDocumentType()
                                               throws javax.xml.xquery.XQException
Specified by:
createDocumentType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createElementType

public javax.xml.xquery.XQItemType createElementType(javax.xml.namespace.QName nodename,
                                                     int basetype)
                                              throws javax.xml.xquery.XQException
Specified by:
createElementType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createElementType

public javax.xml.xquery.XQItemType createElementType(javax.xml.namespace.QName nodename,
                                                     int basetype,
                                                     javax.xml.namespace.QName typename,
                                                     java.net.URI schemaURI,
                                                     boolean allowNill)
                                              throws javax.xml.xquery.XQException
Specified by:
createElementType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItem

public javax.xml.xquery.XQItem createItem(javax.xml.xquery.XQItem item)
                                   throws javax.xml.xquery.XQException
Specified by:
createItem in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromAtomicValue

public javax.xml.xquery.XQItem createItemFromAtomicValue(java.lang.String value,
                                                         javax.xml.xquery.XQItemType type)
                                                  throws javax.xml.xquery.XQException
Specified by:
createItemFromAtomicValue in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromBoolean

public javax.xml.xquery.XQItem createItemFromBoolean(boolean value,
                                                     javax.xml.xquery.XQItemType type)
                                              throws javax.xml.xquery.XQException
Specified by:
createItemFromBoolean in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromByte

public javax.xml.xquery.XQItem createItemFromByte(byte value,
                                                  javax.xml.xquery.XQItemType type)
                                           throws javax.xml.xquery.XQException
Specified by:
createItemFromByte in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromDocument

public javax.xml.xquery.XQItem createItemFromDocument(java.io.InputStream value,
                                                      java.lang.String baseURI,
                                                      javax.xml.xquery.XQItemType type)
                                               throws javax.xml.xquery.XQException
Specified by:
createItemFromDocument in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromDocument

public javax.xml.xquery.XQItem createItemFromDocument(java.io.Reader value,
                                                      java.lang.String baseURI,
                                                      javax.xml.xquery.XQItemType type)
                                               throws javax.xml.xquery.XQException
Specified by:
createItemFromDocument in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromDocument

public javax.xml.xquery.XQItem createItemFromDocument(javax.xml.transform.Source value,
                                                      javax.xml.xquery.XQItemType type)
                                               throws javax.xml.xquery.XQException
Specified by:
createItemFromDocument in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromDocument

public javax.xml.xquery.XQItem createItemFromDocument(java.lang.String value,
                                                      java.lang.String baseURI,
                                                      javax.xml.xquery.XQItemType type)
                                               throws javax.xml.xquery.XQException
Specified by:
createItemFromDocument in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromDocument

public javax.xml.xquery.XQItem createItemFromDocument(org.xml.sax.XMLReader value,
                                                      javax.xml.xquery.XQItemType type)
                                               throws javax.xml.xquery.XQException
Throws:
javax.xml.xquery.XQException

createItemFromDocument

public javax.xml.xquery.XQItem createItemFromDocument(javax.xml.stream.XMLStreamReader value,
                                                      javax.xml.xquery.XQItemType type)
                                               throws javax.xml.xquery.XQException
Specified by:
createItemFromDocument in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromDouble

public javax.xml.xquery.XQItem createItemFromDouble(double value,
                                                    javax.xml.xquery.XQItemType type)
                                             throws javax.xml.xquery.XQException
Specified by:
createItemFromDouble in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromFloat

public javax.xml.xquery.XQItem createItemFromFloat(float value,
                                                   javax.xml.xquery.XQItemType type)
                                            throws javax.xml.xquery.XQException
Specified by:
createItemFromFloat in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromInt

public javax.xml.xquery.XQItem createItemFromInt(int value,
                                                 javax.xml.xquery.XQItemType type)
                                          throws javax.xml.xquery.XQException
Specified by:
createItemFromInt in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromLong

public javax.xml.xquery.XQItem createItemFromLong(long value,
                                                  javax.xml.xquery.XQItemType type)
                                           throws javax.xml.xquery.XQException
Specified by:
createItemFromLong in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromNode

public javax.xml.xquery.XQItem createItemFromNode(org.w3c.dom.Node value,
                                                  javax.xml.xquery.XQItemType type)
                                           throws javax.xml.xquery.XQException
Specified by:
createItemFromNode in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromObject

public javax.xml.xquery.XQItem createItemFromObject(java.lang.Object value,
                                                    javax.xml.xquery.XQItemType type)
                                             throws javax.xml.xquery.XQException
Specified by:
createItemFromObject in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromString

public javax.xml.xquery.XQItem createItemFromString(java.lang.String value,
                                                    javax.xml.xquery.XQItemType type)
                                             throws javax.xml.xquery.XQException
Specified by:
createItemFromString in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemType

public javax.xml.xquery.XQItemType createItemType()
                                           throws javax.xml.xquery.XQException
Specified by:
createItemType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createItemFromShort

public javax.xml.xquery.XQItem createItemFromShort(short value,
                                                   javax.xml.xquery.XQItemType type)
                                            throws javax.xml.xquery.XQException
Specified by:
createItemFromShort in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createNodeType

public javax.xml.xquery.XQItemType createNodeType()
                                           throws javax.xml.xquery.XQException
Specified by:
createNodeType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createProcessingInstructionType

public javax.xml.xquery.XQItemType createProcessingInstructionType(java.lang.String piTarget)
                                                            throws javax.xml.xquery.XQException
Specified by:
createProcessingInstructionType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createSchemaAttributeType

public javax.xml.xquery.XQItemType createSchemaAttributeType(javax.xml.namespace.QName nodename,
                                                             int basetype,
                                                             java.net.URI schemaURI)
                                                      throws javax.xml.xquery.XQException
Specified by:
createSchemaAttributeType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createSchemaElementType

public javax.xml.xquery.XQItemType createSchemaElementType(javax.xml.namespace.QName nodename,
                                                           int basetype,
                                                           java.net.URI schemaURI)
                                                    throws javax.xml.xquery.XQException
Specified by:
createSchemaElementType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createSequence

public javax.xml.xquery.XQSequence createSequence(java.util.Iterator i)
                                           throws javax.xml.xquery.XQException
Specified by:
createSequence in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createSequence

public javax.xml.xquery.XQSequence createSequence(javax.xml.xquery.XQSequence s)
                                           throws javax.xml.xquery.XQException
Specified by:
createSequence in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createSequenceType

public javax.xml.xquery.XQSequenceType createSequenceType(javax.xml.xquery.XQItemType item,
                                                          int occurrence)
                                                   throws javax.xml.xquery.XQException
Specified by:
createSequenceType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException

createTextType

public javax.xml.xquery.XQItemType createTextType()
                                           throws javax.xml.xquery.XQException
Specified by:
createTextType in interface javax.xml.xquery.XQDataFactory
Throws:
javax.xml.xquery.XQException