Working with Schema

The schema section in a ReqIF file consists of the contents of the DATATYPES and SPEC-TYPES elements.

 

 

You can navigate to the Datatypes and SpecTypes collections as shown below:

 

    // Path is relative to current directory
    final String reqIF = "sample-files\\_EV_Specification.reqif";
    // load an existing ReqIF file
    final ReqIFFile reqIFFile = ReqIFFile.load(reqIFPath, m -> System.out.println(m));
    // Get REQ-IF-CONTENT
    final ReqIFContent reqIFContent = reqIFFile.getCoreContent().getReqIFContent();
    // Get DATATYPES
    final Datatypes datatype = reqIFContent.getDatatypes();
    // get SPEC-TYPES
    final SpecTypes specTypes = reqIFContent.getSpecTypes();