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

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

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

  protected void finalize() {
    delete();
  }

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

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

  public XmlModify(String xpath, int operation, int type, String name, String content, int location, XmlQueryContext context) throws XmlException {
    this(dbxml_javaJNI.new_XmlModify__SWIG_0(xpath, operation, type, name, content, location, XmlQueryContext.getCPtr(context)), true);
  }

  public XmlModify(XmlQueryExpression expression, int operation, int type, String name, String content, int location) throws XmlException {
    this(dbxml_javaJNI.new_XmlModify__SWIG_1(XmlQueryExpression.getCPtr(expression), operation, type, name, content, location), true);
  }

  public void setNewEncoding(String newEncoding) throws XmlException {
    dbxml_javaJNI.XmlModify_setNewEncoding(swigCPtr, newEncoding);
  }

  public int getNumModifications() throws XmlException {
    return dbxml_javaJNI.XmlModify_getNumModifications(swigCPtr);
  }

  // enums and constants
  public final static int InsertAfter = dbxml_javaJNI.get_XmlModify_InsertAfter();
  public final static int InsertBefore = dbxml_javaJNI.get_XmlModify_InsertBefore();
  public final static int Append = dbxml_javaJNI.get_XmlModify_Append();
  public final static int Update = dbxml_javaJNI.get_XmlModify_Update();
  public final static int Remove = dbxml_javaJNI.get_XmlModify_Remove();
  public final static int Rename = dbxml_javaJNI.get_XmlModify_Rename();
  public final static int Element = dbxml_javaJNI.get_XmlModify_Element();
  public final static int Attribute = dbxml_javaJNI.get_XmlModify_Attribute();
  public final static int Text = dbxml_javaJNI.get_XmlModify_Text();
  public final static int ProcessingInstruction = dbxml_javaJNI.get_XmlModify_ProcessingInstruction();
  public final static int Comment = dbxml_javaJNI.get_XmlModify_Comment();
  public final static int None = dbxml_javaJNI.get_XmlModify_None();
}
