/* ----------------------------------------------------------------------------
 * 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 XmlQueryExpression {
  private long swigCPtr;
  protected boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

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

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

  public XmlQueryExpression(XmlContainer arg0, XmlQueryContext arg1) throws XmlException {
    this(dbxml_javaJNI.new_XmlQueryExpression(XmlContainer.getCPtr(arg0), XmlQueryContext.getCPtr(arg1)), true);
  }

  public XmlQueryContext getQueryContext() throws XmlException {
    return new XmlQueryContext(dbxml_javaJNI.XmlQueryExpression_getQueryContext(swigCPtr), false);
  }

  public XmlContainer getContainer() throws XmlException {
    return new XmlContainer(dbxml_javaJNI.XmlQueryExpression_getContainer(swigCPtr), false);
  }

  public String getXPathQuery() throws XmlException {
    return dbxml_javaJNI.XmlQueryExpression_getXPathQuery(swigCPtr);
  }

}
