A simple API for embedding CIMCheck into a Java program. The API allows a series of CIM/XML files to be validated against a CIM profile and, optionally, a set of rules.
To use this API, the jar files found in the CIMCheck Distribution must be on the classpath. That is, the classpath should include:
The CIMCheck.jar archive contains code derived from CIMTool. The remaining jar files are third party software on which the software depends.
This class provides the entry point for the CIMCheck API through two public static methods. Then main() method is the entry point for the CIMCheck command line tool. The createChecker() method is an internal entry point that gives finer control over the validation process.
public static Checker createChecker( String profileName, String rulesName)
Checker object which can be used to validate a number of CIM/XML files.
profileName is the pathname of a
.simple-owl file containing the CIM profile to be used in validation. This file can be created by CIMTool and copied from the Profile directory of a CIMTool project.
rulesName is the pathname of a
.rules files containing the interpretation of the profile and the validation process. This file can be created by CIMTool and copied from the Profile directory of a CIMTool project.
rulesName can be
null in which case a built in set of rules is applied.
public static void main( String args )
An instance of this class contains the result of parsing and preprocessing a profile and a rules file. It can be used to validate a number of CIM/XML files.
public int check( String modelName, String workArea, java.io.OutputStream output )
Validates one CIM/XML file.
modelName is the pathname of the CIM/XML file to be validated.
workArea is the pathname of a temporary storage directory used during validation. The directory is created if it does not exist.
output is a stream to which validation messages are written.
The return value is the number of validation errors detected.