Skip to content

InscoperAPI/Build/Java/com.inscoper.api/com/inscoper/api/XMLDocument.java

Packages

Name
com.inscoper.api

Classes

Name
class com.inscoper.api.XMLDocument
XMLDocument class represents an entire XML document.

Source code

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

package com.inscoper.api;
import com.inscoper.api.logging.*;

public class XMLDocument {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

  protected static long swigRelease(XMLDocument obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

  @SuppressWarnings({"deprecation", "removal"})
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        InscoperJNI.delete_XMLDocument(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public XMLDocument() {
    this(InscoperJNI.new_XMLDocument(), true);
  }

  public void loadFile(String xmlFile) throws com.inscoper.api.InscoperException {
    InscoperJNI.XMLDocument_loadFile(swigCPtr, this, xmlFile);
  }

  public boolean tryLoadingFile(String xmlFile) {
    return InscoperJNI.XMLDocument_tryLoadingFile(swigCPtr, this, xmlFile);
  }

  public void saveFile(String xmlFile) throws com.inscoper.api.InscoperException {
    InscoperJNI.XMLDocument_saveFile(swigCPtr, this, xmlFile);
  }

  public XMLNode getChild(String name) {
    return new XMLNode(InscoperJNI.XMLDocument_getChild(swigCPtr, this, name), true);
  }

  public XMLNode toXMLNode() {
    return new XMLNode(InscoperJNI.XMLDocument_toXMLNode(swigCPtr, this), true);
  }

}

Updated on 2026-09-03 at 12:14:19 +0200