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

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

public class DocumentFromXSLGenerator
extends java.lang.Object

This class will transform an xml document with the provided xsd into a lucene document. The resulting XML must pass the schema provided in the resources folder.

Author:
Dan Armbrust

Constructor Summary
DocumentFromXSLGenerator(java.io.File xslFile, boolean validate)
          Construct this document creator from a xsd file.
DocumentFromXSLGenerator(javax.xml.transform.stream.StreamSource xslFile, boolean validate)
          Construct this document creator from a streamSource that is the xsd file
DocumentFromXSLGenerator(java.lang.String xslFileLocation, boolean validate)
          Construct this document creator from a xsd file at the location of xslFileLocation
 
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(javax.xml.transform.stream.StreamSource 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

DocumentFromXSLGenerator

public DocumentFromXSLGenerator(javax.xml.transform.stream.StreamSource xslFile,
                                boolean validate)
                         throws InternalErrorException
Construct this document creator from a streamSource that is the xsd file

Parameters:
xslFile - The file to perform the transfrom with
validate - whether or not to validate the resulting transformation
Throws:
InternalErrorException - If something goes wrong while initializing

DocumentFromXSLGenerator

public DocumentFromXSLGenerator(java.lang.String xslFileLocation,
                                boolean validate)
                         throws InternalErrorException
Construct this document creator from a xsd file at the location of xslFileLocation

Parameters:
xslFileLocation - The file to perform transforms with
validate - whether or not to validate the resulting xml
Throws:
InternalErrorException - If something goes wrong initializing

DocumentFromXSLGenerator

public DocumentFromXSLGenerator(java.io.File xslFile,
                                boolean validate)
                         throws InternalErrorException
Construct this document creator from a xsd file.

Parameters:
xslFile - The file to perform transforms with
validate - whether or not to validate the resulting xml
Throws:
InternalErrorException - If something goes wrong initializing
Method Detail

create

public org.apache.lucene.document.Document create(java.io.File file)
                                           throws java.io.FileNotFoundException,
                                                  ParsingException,
                                                  ReadingException,
                                                  TransformException
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
TransformException

create

public org.apache.lucene.document.Document create(java.lang.String fileLocation)
                                           throws java.io.FileNotFoundException,
                                                  ParsingException,
                                                  ReadingException,
                                                  TransformException
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
TransformException

create

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

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

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.