/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version: 1.3.19
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.sleepycat.dbxml;


public class XmlQueryContext {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected XmlQueryContext(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected XmlQueryContext() {
    this(0, false);
  }

  protected void finalize() {
    delete();
  }

  public void delete() /* no exception */ {
    if(swigCPtr != 0 && swigCMemOwn) {
      dbxml_javaJNI.delete_XmlQueryContext(swigCPtr);
      swigCMemOwn = false;
    }
    swigCPtr = 0;
  }

  protected static long getCPtr(XmlQueryContext obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  public XmlQueryContext(int returnType, int evaluationType) throws XmlException {
    this(dbxml_javaJNI.new_XmlQueryContext(returnType, evaluationType), true);
  }

  public void setNamespace(String prefix, String uri) throws XmlException {
    dbxml_javaJNI.XmlQueryContext_setNamespace(swigCPtr, prefix, uri);
  }

  public String getNamespace(String prefix) throws XmlException {
    return dbxml_javaJNI.XmlQueryContext_getNamespace(swigCPtr, prefix);
  }

  public void removeNamespace(String prefix) throws XmlException {
    dbxml_javaJNI.XmlQueryContext_removeNamespace(swigCPtr, prefix);
  }

  public void clearNamespaces() throws XmlException {
    dbxml_javaJNI.XmlQueryContext_clearNamespaces(swigCPtr);
  }

  public void setVariableValue(String name, XmlValue value) throws XmlException {
    dbxml_javaJNI.XmlQueryContext_setVariableValue(swigCPtr, name, XmlValue.getCPtr(value));
  }

  public void setReturnType(int type) throws XmlException {
    dbxml_javaJNI.XmlQueryContext_setReturnType(swigCPtr, type);
  }

  public int getReturnType() throws XmlException {
    return dbxml_javaJNI.XmlQueryContext_getReturnType(swigCPtr);
  }

  public void setEvaluationType(int type) throws XmlException {
    dbxml_javaJNI.XmlQueryContext_setEvaluationType(swigCPtr, type);
  }

  public int getEvaluationType() throws XmlException {
    return dbxml_javaJNI.XmlQueryContext_getEvaluationType(swigCPtr);
  }

  public void setWithMetaData(boolean withMetaData) throws XmlException {
    dbxml_javaJNI.XmlQueryContext_setWithMetaData(swigCPtr, withMetaData);
  }

  public boolean getWithMetaData() throws XmlException {
    return dbxml_javaJNI.XmlQueryContext_getWithMetaData(swigCPtr);
  }

  public XmlValue getVariableValue(String name) throws XmlException {
    long cPtr = dbxml_javaJNI.XmlQueryContext_getVariableValue(swigCPtr, name);
    return (cPtr == 0) ? null : new XmlValue(cPtr, true);
  }

  // enums and constants
  public final static int ResultDocuments = dbxml_javaJNI.get_XmlQueryContext_ResultDocuments();
  public final static int ResultValues = dbxml_javaJNI.get_XmlQueryContext_ResultValues();
  public final static int CandidateDocuments = dbxml_javaJNI.get_XmlQueryContext_CandidateDocuments();
  public final static int ResultDocumentsAndValues = dbxml_javaJNI.get_XmlQueryContext_ResultDocumentsAndValues();
  public final static int Eager = dbxml_javaJNI.get_XmlQueryContext_Eager();
  public final static int Lazy = dbxml_javaJNI.get_XmlQueryContext_Lazy();
}
