net.sf.saxon.xqj
Class SaxonXQSequence

java.lang.Object
  extended by net.sf.saxon.xqj.Closable
      extended by net.sf.saxon.xqj.SaxonXQSequence
All Implemented Interfaces:
javax.xml.xquery.XQItemAccessor, javax.xml.xquery.XQResultSequence, javax.xml.xquery.XQSequence, SaxonXQItemAccessor

public class SaxonXQSequence
extends Closable
implements javax.xml.xquery.XQResultSequence, SaxonXQItemAccessor

Saxon implementation of the XQSequence interface in XQJ, which represents an XDM sequence together with a current position. This class is used for a sequence that can be read forwards, backwards, or by absolute position.


Constructor Summary
SaxonXQSequence(Value value, SaxonXQDataFactory factory)
           
SaxonXQSequence(Value value, SaxonXQPreparedExpression expression)
           
 
Method Summary
 boolean absolute(int itempos)
           
 void afterLast()
           
 void beforeFirst()
           
 int count()
           
 boolean first()
           
 java.lang.String getAtomicValue()
           
 boolean getBoolean()
           
 byte getByte()
           
(package private)  Configuration getConfiguration()
           
 javax.xml.xquery.XQConnection getConnection()
           
 double getDouble()
           
 float getFloat()
           
 int getInt()
           
 javax.xml.xquery.XQItem getItem()
           
 javax.xml.stream.XMLStreamReader getItemAsStream()
           
 java.lang.String getItemAsString(java.util.Properties props)
           
 javax.xml.xquery.XQItemType getItemType()
           
 long getLong()
           
 org.w3c.dom.Node getNode()
           
 java.net.URI getNodeUri()
           
 java.lang.Object getObject()
           
 int getPosition()
           
 Item getSaxonItem()
          Get the current item
 javax.xml.stream.XMLStreamReader getSequenceAsStream()
           
 java.lang.String getSequenceAsString(java.util.Properties props)
           
 short getShort()
           
(package private)  Value getValue()
           
 boolean instanceOf(javax.xml.xquery.XQItemType type)
           
 boolean isAfterLast()
           
 boolean isBeforeFirst()
           
 boolean isFirst()
           
 boolean isLast()
           
 boolean isOnItem()
           
 boolean isScrollable()
           
 boolean last()
           
 boolean next()
           
 boolean previous()
           
 boolean relative(int itempos)
           
(package private) static java.util.Properties setDefaultProperties(java.util.Properties props)
           
 void writeItem(java.io.OutputStream os, java.util.Properties props)
           
 void writeItem(java.io.Writer ow, java.util.Properties props)
           
 void writeItemToResult(javax.xml.transform.Result result)
           
 void writeItemToSAX(org.xml.sax.ContentHandler saxHandler)
           
 void writeSequence(java.io.OutputStream os, java.util.Properties props)
           
 void writeSequence(java.io.Writer ow, java.util.Properties props)
           
 void writeSequenceToResult(javax.xml.transform.Result result)
           
 void writeSequenceToSAX(org.xml.sax.ContentHandler saxHandler)
           
 
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
 
Methods inherited from interface javax.xml.xquery.XQSequence
close, isClosed
 

Constructor Detail

SaxonXQSequence

SaxonXQSequence(Value value,
                SaxonXQDataFactory factory)

SaxonXQSequence

SaxonXQSequence(Value value,
                SaxonXQPreparedExpression expression)
Method Detail

getValue

Value getValue()

getConfiguration

Configuration getConfiguration()

absolute

public boolean absolute(int itempos)
                 throws javax.xml.xquery.XQException
Specified by:
absolute in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

afterLast

public void afterLast()
               throws javax.xml.xquery.XQException
Specified by:
afterLast in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

beforeFirst

public void beforeFirst()
                 throws javax.xml.xquery.XQException
Specified by:
beforeFirst in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

count

public int count()
          throws javax.xml.xquery.XQException
Specified by:
count in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

first

public boolean first()
              throws javax.xml.xquery.XQException
Specified by:
first in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

getItem

public javax.xml.xquery.XQItem getItem()
                                throws javax.xml.xquery.XQException
Specified by:
getItem in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

getSaxonItem

public Item getSaxonItem()
                  throws javax.xml.xquery.XQException
Description copied from interface: SaxonXQItemAccessor
Get the current item

Specified by:
getSaxonItem in interface SaxonXQItemAccessor
Returns:
the current item
Throws:
javax.xml.xquery.XQException

getPosition

public int getPosition()
                throws javax.xml.xquery.XQException
Specified by:
getPosition in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

getSequenceAsStream

public javax.xml.stream.XMLStreamReader getSequenceAsStream()
                                                     throws javax.xml.xquery.XQException
Specified by:
getSequenceAsStream in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

getSequenceAsString

public java.lang.String getSequenceAsString(java.util.Properties props)
                                     throws javax.xml.xquery.XQException
Specified by:
getSequenceAsString in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

isAfterLast

public boolean isAfterLast()
                    throws javax.xml.xquery.XQException
Specified by:
isAfterLast in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

isBeforeFirst

public boolean isBeforeFirst()
                      throws javax.xml.xquery.XQException
Specified by:
isBeforeFirst in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

isFirst

public boolean isFirst()
                throws javax.xml.xquery.XQException
Specified by:
isFirst in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

isLast

public boolean isLast()
               throws javax.xml.xquery.XQException
Specified by:
isLast in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

isOnItem

public boolean isOnItem()
                 throws javax.xml.xquery.XQException
Specified by:
isOnItem in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

isScrollable

public boolean isScrollable()
                     throws javax.xml.xquery.XQException
Specified by:
isScrollable in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

last

public boolean last()
             throws javax.xml.xquery.XQException
Specified by:
last in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

next

public boolean next()
             throws javax.xml.xquery.XQException
Specified by:
next in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

previous

public boolean previous()
                 throws javax.xml.xquery.XQException
Specified by:
previous in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

relative

public boolean relative(int itempos)
                 throws javax.xml.xquery.XQException
Specified by:
relative in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

writeSequence

public void writeSequence(java.io.OutputStream os,
                          java.util.Properties props)
                   throws javax.xml.xquery.XQException
Specified by:
writeSequence in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

writeSequence

public void writeSequence(java.io.Writer ow,
                          java.util.Properties props)
                   throws javax.xml.xquery.XQException
Specified by:
writeSequence in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

writeSequenceToResult

public void writeSequenceToResult(javax.xml.transform.Result result)
                           throws javax.xml.xquery.XQException
Specified by:
writeSequenceToResult in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

writeSequenceToSAX

public void writeSequenceToSAX(org.xml.sax.ContentHandler saxHandler)
                        throws javax.xml.xquery.XQException
Specified by:
writeSequenceToSAX in interface javax.xml.xquery.XQSequence
Throws:
javax.xml.xquery.XQException

getAtomicValue

public java.lang.String getAtomicValue()
                                throws javax.xml.xquery.XQException
Specified by:
getAtomicValue in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getBoolean

public boolean getBoolean()
                   throws javax.xml.xquery.XQException
Specified by:
getBoolean in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getByte

public byte getByte()
             throws javax.xml.xquery.XQException
Specified by:
getByte in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getDouble

public double getDouble()
                 throws javax.xml.xquery.XQException
Specified by:
getDouble in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getFloat

public float getFloat()
               throws javax.xml.xquery.XQException
Specified by:
getFloat in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getInt

public int getInt()
           throws javax.xml.xquery.XQException
Specified by:
getInt in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getItemAsStream

public javax.xml.stream.XMLStreamReader getItemAsStream()
                                                 throws javax.xml.xquery.XQException
Specified by:
getItemAsStream in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getItemAsString

public java.lang.String getItemAsString(java.util.Properties props)
                                 throws javax.xml.xquery.XQException
Specified by:
getItemAsString in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getItemType

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

getLong

public long getLong()
             throws javax.xml.xquery.XQException
Specified by:
getLong in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getNode

public org.w3c.dom.Node getNode()
                         throws javax.xml.xquery.XQException
Specified by:
getNode in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getNodeUri

public java.net.URI getNodeUri()
                        throws javax.xml.xquery.XQException
Specified by:
getNodeUri in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getObject

public java.lang.Object getObject()
                           throws javax.xml.xquery.XQException
Specified by:
getObject in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getShort

public short getShort()
               throws javax.xml.xquery.XQException
Specified by:
getShort in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

instanceOf

public boolean instanceOf(javax.xml.xquery.XQItemType type)
                   throws javax.xml.xquery.XQException
Specified by:
instanceOf in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

writeItem

public void writeItem(java.io.OutputStream os,
                      java.util.Properties props)
               throws javax.xml.xquery.XQException
Specified by:
writeItem in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

writeItem

public void writeItem(java.io.Writer ow,
                      java.util.Properties props)
               throws javax.xml.xquery.XQException
Specified by:
writeItem in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

writeItemToResult

public void writeItemToResult(javax.xml.transform.Result result)
                       throws javax.xml.xquery.XQException
Specified by:
writeItemToResult in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

writeItemToSAX

public void writeItemToSAX(org.xml.sax.ContentHandler saxHandler)
                    throws javax.xml.xquery.XQException
Specified by:
writeItemToSAX in interface javax.xml.xquery.XQItemAccessor
Throws:
javax.xml.xquery.XQException

getConnection

public javax.xml.xquery.XQConnection getConnection()
                                            throws javax.xml.xquery.XQException
Specified by:
getConnection in interface javax.xml.xquery.XQResultSequence
Throws:
javax.xml.xquery.XQException

setDefaultProperties

static java.util.Properties setDefaultProperties(java.util.Properties props)