edu.mayo.informatics.indexer.api.generators
Class DocumentFromXMLGenerator

java.lang.Object
  extended by edu.mayo.informatics.indexer.api.generators.DocumentFromXMLGenerator

public class DocumentFromXMLGenerator
extends java.lang.Object

This class will parse XML into a lucene document. The XML must pass the schema provided in the resources folder.

Author:
Dan Armbrust

Constructor Summary
DocumentFromXMLGenerator(boolean validate)
           
 
Method Summary
 org.apache.lucene.document.Document create(java.io.File file)
          Creates an indexer ready document from an xml file on disk.
 org.apache.lucene.document.Document create(org.xml.sax.InputSource source)
          Creates a indexer ready document from an InputSource (probably a stream)
 org.apache.lucene.document.Document create(java.lang.String fileLocation)
          Creates an indexer ready document from a file whos located at fileLocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentFromXMLGenerator

public DocumentFromXMLGenerator(boolean validate)
                         throws InternalErrorException
Throws:
InternalErrorException
Method Detail

create

public org.apache.lucene.document.Document create(java.io.File file)
                                           throws java.io.FileNotFoundException,
                                                  ParsingException,
                                                  ReadingException
Creates an indexer ready document from an xml file on disk.

Parameters:
file - The file to index.
Returns:
The document
Throws:
java.io.FileNotFoundException
ParsingException
ReadingException

create

public org.apache.lucene.document.Document create(java.lang.String fileLocation)
                                           throws java.io.FileNotFoundException,
                                                  ParsingException,
                                                  ReadingException
Creates an indexer ready document from a file whos located at fileLocation.

Parameters:
fileLocation - Where to read the file from
Returns:
The document
Throws:
java.io.FileNotFoundException
ParsingException
ReadingException

create

public org.apache.lucene.document.Document create(org.xml.sax.InputSource source)
                                           throws ParsingException,
                                                  ReadingException
Creates a indexer ready document from an InputSource (probably a stream)

Parameters:
source - The source to index
Returns:
the document
Throws:
ParsingException
ReadingException

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.