1 22 23 package org.xquark.mediator.plan; 24 25 import org.xml.sax.ContentHandler ; 26 import org.xquark.mediator.runtime.MediatorException; 27 import org.xquark.schema.validation.PSVInfoSetProvider; 28 import org.xquark.xml.xdbc.XMLDBCException; 29 import org.xquark.xquery.xdbc.XDBCResultSetInterface; 30 31 public class PlanResultSet implements XDBCResultSetInterface { 32 private static final String RCSRevision = "$Revision: 1.10 $"; 36 private static final String RCSName = "$Name: $"; 37 protected ContentHandler handler = null; 41 protected org.xml.sax.ErrorHandler error_handler = null; 42 protected org.xml.sax.ext.LexicalHandler lexical_handler = null; 43 44 protected ResultSet opResultset; 45 46 52 public PlanResultSet(ResultSet opResultset) throws XMLDBCException { 53 this.opResultset = opResultset; 54 } 55 56 67 public String fetch(String path, int nodeAccessor) throws XMLDBCException { 68 return fetch(path, nodeAccessor, null); 69 } 70 public String fetch(String path, int nodeAccessor, String loopID) throws XMLDBCException { 71 return fetch(path, nodeAccessor, loopID, null); 72 } 73 public String fetch(String path, int nodeAccessor, String loopID, PSVInfoSetProvider psvisp) throws XMLDBCException { 74 return opResultset.fetch(path, nodeAccessor, loopID, psvisp); 75 } 76 77 84 public void generate(String path, int nodeAccessor) throws XMLDBCException { 85 generate(path, nodeAccessor, null); 86 } 87 public void generate(String path, int nodeAccessor, String loopID) throws XMLDBCException { 88 generate(path, nodeAccessor, loopID, null); 89 } 90 public void generate(String path, int nodeAccessor, String loopID, PSVInfoSetProvider psvisp) throws XMLDBCException { 91 opResultset.generate(handler, path, nodeAccessor, loopID, psvisp); 92 } 93 94 99 public void getIdentifiers(Object [] identifiers) throws XMLDBCException { 100 opResultset.getIdentifiers(identifiers); 101 } 102 103 108 public void getNextIdentifiers(Object [] identifiers) throws XMLDBCException { 109 try { 110 opResultset.getNextIdentifiers(identifiers); 111 } catch (MediatorException me) { 112 throw new XMLDBCException(me.getMessage(), me); 113 } 114 } 115 116 121 public boolean next() throws XMLDBCException { 122 try { 123 opResultset.next(); 124 } catch (MediatorException me) { 125 throw new XMLDBCException(me.getMessage(), me); 126 } 127 return true; 128 } 129 130 134 public boolean hasNext() throws XMLDBCException { 135 try { 136 return opResultset.hasNext(); 137 } catch (MediatorException me) { 138 throw new XMLDBCException(me.getMessage(), me); 139 } 140 } 141 142 147 public void setContentHandler(ContentHandler handler) { 148 this.handler = handler; 149 } 150 151 158 public void setErrorHandler(org.xml.sax.ErrorHandler handler) { 159 this.error_handler = handler; 160 } 161 162 169 public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler) { 170 this.lexical_handler = handler; 171 } 172 173 177 public void close() throws XMLDBCException { 178 try { 179 opResultset.close(); 180 } catch (MediatorException me) { 181 throw new XMLDBCException(me.getMessage(), me); 182 } 183 } 184 } 185 | Popular Tags |