jet.api
Class XMLConverter

java.lang.Object
  extended by jet.api.XMLConverter

public class XMLConverter
extends java.lang.Object

Converts internal binary file format to xml format and vice versa.

XMLConverter converter = new XMLConverter();

converter.setDebugLevel(vDebug);

converter.B2XML(binaryCatFilPath, null);


Field Summary
static int vDebug
          Indicates to open the debug.
static int vError
          Indicates to open the error.
static int vOff
          Indicates to close the debug.
 
Constructor Summary
XMLConverter()
           
 
Method Summary
 java.lang.String B2XML(java.lang.String binaryFileName, java.lang.String xmlFileFolder)
          Converts the binary file to an xml format file.
 boolean saveAs(java.lang.String srcCatFullPath, java.lang.String destCatFullPath)
          Saves the catalog file as another file, using the file extension to control the format.
 void setDebugLevel(int level)
          Sets the debug level for JReport Designer.
 boolean setLogFile(java.lang.String fileName)
          Sets the log file.
 java.lang.String XML2B(java.lang.String xmlFileName, java.lang.String binaryFileFolder)
          Converts the XML format file to a binary file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vOff

public static final int vOff
Indicates to close the debug.

See Also:
setDebugLevel(int)

vDebug

public static final int vDebug
Indicates to open the debug.

See Also:
setDebugLevel(int)

vError

public static final int vError
Indicates to open the error.

See Also:
setDebugLevel(int)
Constructor Detail

XMLConverter

public XMLConverter()
Method Detail

setDebugLevel

public void setDebugLevel(int level)
Sets the debug level for JReport Designer.

See Also:
vOff, vDebug, vError

setLogFile

public boolean setLogFile(java.lang.String fileName)
Sets the log file.

Parameters:
fileName - the log file name

LogFileName specifies where the debug, error and other information will go. LogFileName contains both the path and the file name. If no path is specified, the current path is used. If no file name is specified, the file jreport.log is used

Returns:
true if successful

B2XML

public java.lang.String B2XML(java.lang.String binaryFileName,
                              java.lang.String xmlFileFolder)
Converts the binary file to an xml format file.

Parameters:
binaryFileName - The full path and name of the binary file.
xmlFileFolder - The full path of the XML format file. If omitted, it will be saved to the folder where the binary file resides.
Returns:
The full path and name of the XML file if the conversion is successful; otherwise null.

XML2B

public java.lang.String XML2B(java.lang.String xmlFileName,
                              java.lang.String binaryFileFolder)
Converts the XML format file to a binary file.

Parameters:
xmlFileName - The full path and name of the XML file.
binaryFileFolder - The full path of the binary file. If omitted, it will be saved to the folder where the XML file resides.
Returns:
The full path and name of the binary file if the conversion is successful; otherwise null.

saveAs

public boolean saveAs(java.lang.String srcCatFullPath,
                      java.lang.String destCatFullPath)
Saves the catalog file as another file, using the file extension to control the format. If there exists prejoin files in the catalog, it will also be included in the conversion.

"*.cat" indicates a binary file, "*.cat.xml" indicates an XML file.