Altova XMLSpy 2025 Enterprise Edition

Im nachstehenden Code wird gezeigt, wie man die Applikation startet und beendet.

 

Starten der Applikation

Bevor Sie die Applikation starten müssen die entsprechenden Klassen importiert werden (siehe unten).

 

01 // Access general JAVA-COM bridge classes

02 import com.altova.automation.libs.*;

03

04 // Access XMLSpy Java-COM bridge

05 import com.altova.automation.XMLSpy.*;

06 import com.altova.automation.XMLSpy.Enums.SPYViewModes;

07

08 /**

09  * An example that starts XMLSpy COM server and performs view operations on it

10  * Feel free to extend

11  */

12 public class RunXMLSpy

13 {

14   public static void main(String[] args)

15   {

16     // An instance of the application.

17     Application xmlSpy = null;

18

19     // Instead of COM error handling, use Java exception mechanism

20     try

21     {

22         // Start XMLSpy as COM server

23           xmlSpy = new Application();

24         // COM servers start up invisible, so make it visible

25           xmlSpy.setVisible(true);

26

27 ...

28     }

29   }

30 }

 

Beenden der Applikation

Die Applikation kann wie unten gezeigt beendet werden.

 

01 {

02       // Allow shutdown of XMLSpy by releasing the UI.

03       xmlSpy.setVisible(true);

04

05       // Make sure that XMLSpy can shut down properly.

06       if (xmlSpy != null)

07         xmlSpy.dispose();

08

09       // Since the COM server was made visible and still is visible,

10       // it will keep running, and needs to be closed manually.

11       System.out.println("Now close XMLSpy!");

12 }

 

© 2018-2024 Altova GmbH