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:

CIMCheck.jar
scala-library.jar
icu4j_3_4.jar
iri.jar
jena.jar
log4j-1.2.12.jar
slf4j-api-1.5.6.jar
slf4j-log4j12-1.5.6.jar
xercesImpl.jar

The CIMCheck.jar archive contains code derived from CIMTool. The remaining jar files are third party software on which the software depends.

package au.com.langdale
class CIMCheck

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)

Creates a Checker object which can be used to validate a number of CIM/XML files.

The 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.

The 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.

The rulesName can be null in which case a built in set of rules is applied.

public static void main( String[] args )

This is the entry point for the CIMCheck command line tool. The args are interpreted as per the CIMCheck manual page.

package au.com.langdale
class Checker

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.

The modelName is the pathname of the CIM/XML file to be validated.

The workArea is the pathname of a temporary storage directory used during validation. The directory is created if it does not exist.

The output is a stream to which validation messages are written.

The return value is the number of validation errors detected.