
|
AnyToXML: JAVA Interface
|
Using the Java(TM) Native Interface (JNI), Redix provides an API module,
e.g., RedixAPI.DLL in the Windows environment, that allows
the user to integrate the Redix
XML/DTD/EDI Converter engine with the user's existing Java applications.
The following is
a Java(TM) sample that was generated by the Redix XML/DTD/EDI Authoring Tools;
this sample calls the redix_ncc
function.
/** This is a sample program, which calls the Redix API function through JNI
*/
public class Redix
{
public native int redix_vofd(String ifd_filename, String ofd_filename,
String err_report);
public native int redix_vifd(String ifd_filename, String err_filename);
public native int redix_ncc(String config_filename);
static
{
// RedixAPI.DLL is
a Java wrapper
System.loadLibrary(
"RedixAPI" );
}
// Sample call uses redix_ncc
public static void main( String args[] )
{
Redix hi = new
Redix();
int ret =
hi.redix_ncc(args[0]);
System.out.println("Returning
code " + ret);
}
public Redix()
{
}
}
|
|