Mimedir Parser The Mimedir Parser is a package of java classes that together implement a parser of the MIMEDIR data format as defined in RFC2425. The API that the parser exposes is inspired by the Simple API for XML (SAX) that is described on http://www.megginson.com/SAX/. The code is released under the GNU GPL (please see the file LICENCE). If you find bugs (or even better, fix them) please send an email to mimedir@metamatrix.se and I might be able to help you. Other contributions are also welcome of course. Requirements The code was developed with Java 1.3 from sun, but should work with any java enviroment. Haven't tested though. Usage To use the parser you create a class that is to be notified of parsed lines. This class must implement the ContentHandler interface. Then you instanciate a Parser giving the ContentHandler class to it's constructor.(If you also want error messages, then create a class implementing ErrorHandler also). Then you use parse() with the data source as the parameter (It can either be a Reader or an InputStream). When the parser has successfully parsed a line of input, it calls the contentLine() method of your ContentHandler, effectively handing over control to your code. If anything goes wrong, the error() method of the ErrorHandler is called. The default behaviour of the parser is to treat everything as text, and return a String as the value parameter of the contentLine() method. But this can be changed by using the setValues() method of the parser prior to parsing. There three builtin datatypes that can be used instead of the default 'text' and those are 'datetime', 'integer' and 'boolean'. That makes contentLine() return value parameters of type Date, Integer, and Boolean repsectively. You can also hook in custom code that generates values of other classes by creating classes that implement ValueFactory. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL METAMATRIX DEVELOPMENT & CONSULTING OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.