|
xml2class XML data structures |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object | +--xml2class.XMLFile
An auxiliary class for XML file handling. It allows even more facilitated file parsing and saving in several different parameter combinations. For best parsing control, it is recommended to implement these methods in your own code.
XML2ClassParser,
X2cTools,
X2cException| Constructor Summary | |
XMLFile()
|
|
| Method Summary | |
static void |
main(java.lang.String[] args)
Allows to parse from the command line a XML file, which should contain also instructions on how to proceed when the parsing process is complete. Syntax: XMLFile [directory/filename.xml] [package.name] [verbose]. |
static java.lang.Object |
parse(java.lang.String filename,
java.lang.String classRoot)
Parse directly a whole structure from a file. |
static java.lang.Object |
parse(java.lang.String filename,
java.lang.String[] classRoots,
boolean verbose,
boolean resource)
Parse directly a whole structure from a (resource) file. |
static java.lang.Object |
parse(java.lang.String filename,
java.lang.String classRoot,
boolean verbose)
Parse directly a whole structure from a file. |
static java.lang.Object |
parseResource(java.lang.String filename,
java.lang.String classRoot)
Parse directly a whole structure from a resource file. |
static java.lang.Object |
parseResource(java.lang.String filename,
java.lang.String classRoot,
boolean verbose)
Parse directly a whole structure from a resource file. |
static void |
save(java.lang.Object root,
java.lang.String filename)
Save the data structure - given its root element - back to a file. |
static void |
save(java.lang.Object root,
java.lang.String filename,
java.lang.String doctype)
Save the data structure - given its root element - back to a file. |
static void |
save(java.lang.String xmlString,
java.lang.String filename,
java.lang.String doctype,
boolean resource)
Save the data structure - given its XML representation - back to a (resource) file. |
static void |
saveResource(java.lang.Object root,
java.lang.String filename)
Save the data structure - given its root element - back to a resource file. |
static void |
saveResource(java.lang.Object root,
java.lang.String filename,
java.lang.String doctype)
Save the data structure - given its root element - back to a resource file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XMLFile()
| Method Detail |
public static java.lang.Object parse(java.lang.String filename,
java.lang.String classRoot)
throws X2cException
filename - the XML file to be parsed (incl. relative path).classRoot - where the respective class files are (relative paths, separated by spaces).X2cException - will be thrown at any exceptional situation.
public static java.lang.Object parse(java.lang.String filename,
java.lang.String classRoot,
boolean verbose)
throws X2cException
filename - the XML file to be parsed (incl. relative path).classRoot - where the respective class files are (relative paths, separated by spaces).verbose - should the parser be in verbose mode (verbose output to System.out)?X2cException - will be thrown at any exceptional situation.
public static java.lang.Object parseResource(java.lang.String filename,
java.lang.String classRoot)
throws X2cException
filename - the XML file to be parsed (incl. relative path).classRoot - where the respective class files are (relative paths, separated by spaces).X2cException - will be thrown at any exceptional situation.
public static java.lang.Object parseResource(java.lang.String filename,
java.lang.String classRoot,
boolean verbose)
throws X2cException
filename - the XML file to be parsed (incl. relative path).classRoot - where the respective class files are (relative paths, separated by spaces).verbose - should the parser be in verbose mode (verbose output to System.out)?X2cException - will be thrown at any exceptional situation.
public static java.lang.Object parse(java.lang.String filename,
java.lang.String[] classRoots,
boolean verbose,
boolean resource)
throws X2cException
filename - the XML file to be parsed (incl. relative path).classRoots - where the respective class files are (relative paths).verbose - should the parser be in verbose mode (verbose output to System.out)?resource - is the indicated file available as resource file?X2cException - will be thrown at any exceptional situation.
public static void save(java.lang.Object root,
java.lang.String filename)
throws X2cOutputException
toXMLString()!root - the data structure's root element.filename - where the structure should be saved to (incl. relative path).X2cOutputException - will be thrown for any exception.
public static void save(java.lang.Object root,
java.lang.String filename,
java.lang.String doctype)
throws X2cOutputException
[rootElementName] SYSTEM "[DTD file name]").
Beware: The structure's elements must support toXMLString()!root - the data structure's root element.filename - where the structure should be saved to (incl. relative path).doctype - a doctype definition string.X2cOutputException - will be thrown for any exception.
public static void saveResource(java.lang.Object root,
java.lang.String filename)
throws X2cOutputException
toXMLString()!
Important note: this method does not seem to work under JDK1.1!root - the data structure's root element.filename - where the structure should be saved to (incl. relative path).X2cOutputException - will be thrown for any exception.
public static void saveResource(java.lang.Object root,
java.lang.String filename,
java.lang.String doctype)
throws X2cOutputException
[rootElementName] SYSTEM "[DTD file name]").
Beware: The structure's elements must support toXMLString()!
Important note: this method does not seem to work under JDK1.1!root - the data structure's root element.filename - where the structure should be saved to (incl. relative path).doctype - a doctype definition string.X2cOutputException - will be thrown for any exception.
public static void save(java.lang.String xmlString,
java.lang.String filename,
java.lang.String doctype,
boolean resource)
throws X2cOutputException
[rootElementName] SYSTEM "[DTD file name]").
Use this method, if you do the toXML conversion outside the
data structure.
Important note: saving to a resource file does not seem to work under JDK1.1!xmlString - the data structure's XML representation.filename - where the structure should be saved to (incl. relative path).doctype - a doctype definition string.resource - is the indicated file a resource file?X2cOutputException - will be thrown for any exception.
public static void main(java.lang.String[] args)
throws X2cException
Allows to parse from the command line a XML file, which should contain also instructions on how to proceed when the parsing process is complete.
Syntax: XMLFile [directory/filename.xml] [package.name] [verbose].
|
xml2class XML data structures |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||