JSDAI examples

Several example programs are provided together with JSDAI installation. All example programs can be found in the examples directory within the installation.

In this page we cover several of these examples.

SdaiTerm

We strongly recommend you playing with this tool before starting writing your own application. You can use this program without any knowledge of Java. All major SDAI operations are available as 2 character commands. Just type in a sequence of operations and see how JSDAI behaves. Every error condition will be clearly indicated.

The program consists of:

  • Full documentation (SdaiTerm.html)
  • Java source file, late binding (SdaiTerm.java)

ImportExport

Simply imports and then exports a p21-file without making the data persistent.

  • Java source file (ImportExport.java)

Generating some AP203 entities and exporting them into a p21 File

  • with early binding methods (Example11.java) (recommended)
  • with late binding methods (Example12.java)

GenerateExpress

Converts the available dictionary information back to EXPRESS syntax and lists it on the screen.

  • Java source file (GenerateExpress.java)

Validation

Reads in a p21-file and performs some validation operations.

Please note that only several validation operations are functioning in this version of JSDAI. A future version of JSDAI will have all validation operations (when full expression evaluation will be available). Please note that this example may fail on instances of some subtype entities which contain explicit attributes of a supertype which are redeclared as derived.

  • Java source file (Validation.java)