xml2class
XML data structures

Package xml2class

Provides you with a simple XML parser, which instantiates data structures written in Java out of a XML description (and supports storing them back as XML code).

See:
          Description

Interface Summary
XMLSaveable For convenience reasons, any class which is able to describe itself in XML (in order to be written to a file) may implement this interface.
 

Class Summary
X2cTools This class provides some utility methods for the whole xml2class package.
XML2ClassParser The XML2ClassParser extracts data about a present data structure (i.e. it must already be implemented) out of XML code and instantiates a new instance of it with the values available from an XML source.
XMLFile An auxiliary class for XML file handling.
 

Exception Summary
X2cClassBuildingException This exception is thrown when one of the XML elements or attributes did not correspond to an already present class or method, so that Java couldn't build that object. Any ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException and InvocationTargetException will be converted to a X2cClassBuildingException.
X2cException This exception class is superclass of any exception thrown by xml2class.
X2cInputException Any IOException occuring during the parsing process will be converted into a X2cInputException in order to facilitate exception handling.
X2cInvalidTagException This exception is thrown when a tag or an entity is invalid (bad syntax).
X2cOutputException An X2cOutputException is thrown, when there was any exception while trying to save a data structure back to a XML file.
X2cTagException This exception is thrown when an (end)tag is missing or when there was an unexpected or unknown tag or entity. When this exception is thrown, it usually is a sign for not well-formed / valid XML.
 

Package xml2class Description

Provides you with a simple XML parser, which instantiates data structures written in Java out of a XML description (and supports storing them back as XML code). It is thought as an aid for programmers, as it won't do all the work for you.

With the aid of xml2class you may describe most data structures (such as linked lists, binary trees, tables, menus, and so on) in easy to modify XML. Following the XML descriptions, it won't be difficult to write the corresponding Java classes. Then the XML2ClassParser will read in and instantiate the entire structure in a way that you may save it back to disk easily (in XML).

For more information on how to write your XML files and Java classes, have a look at the xml2class introduction and at an example (string stack).

Version 05/08/01 - Copyleft (C) 2001 by Simon Bünzli


xml2class
XML data structures

Copyleft 2001 by Simon Bünzli, zeniko@gmx.ch