org.openprivacy.reptile.search
Class SearchSerializer

java.lang.Object
  |
  +--org.openprivacy.reptile.search.SearchSerializer

public class SearchSerializer
extends java.lang.Object

Provides a mechanism for searializing pages of a SearchProviders results into an XML representation.

Version:
$Id: SearchSerializer.java,v 1.19 2002/02/19 01:33:46 burton Exp $
Author:
Kevin A. Burton

Field Summary
static int FIRST_PAGE
           
static int RECORDS_PER_PAGE
           
 
Constructor Summary
SearchSerializer(SearchProvider provider)
          Create a new SearchSerializer instance.
 
Method Summary
 int getPageCount()
          Determine the number of 'pages' that this SearchProvider found in the last search.
 SearchProvider getProvider()
          Get the value of provider.
 org.jdom.Element serialize(int page)
           Serialize the given page a XML.
 org.w3c.dom.Document serializeAsDocument(int page)
           
 org.w3c.dom.Node serializeAsNode(int page)
          Serialize this page as a W3C DOM Node (probably for use within Xalan)
 java.lang.String serializeAsString(int page)
          Serialize this page as a String (probably for use within a test or for human evaluation.)
 void setProvider(SearchProvider provider)
          Set the value of provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_PAGE

public static final int FIRST_PAGE
See Also:
Constant Field Values

RECORDS_PER_PAGE

public static final int RECORDS_PER_PAGE
See Also:
Constant Field Values
Constructor Detail

SearchSerializer

public SearchSerializer(SearchProvider provider)
Create a new SearchSerializer instance.

Method Detail

getPageCount

public int getPageCount()
Determine the number of 'pages' that this SearchProvider found in the last search.


serialize

public org.jdom.Element serialize(int page)
                           throws java.lang.Exception

Serialize the given page a XML. Note that if you specify an invalid page we will throw an exception.

All page indexes begin at 0.

The XML format we should return is the standard Reptile search markup.

java.lang.Exception

serializeAsString

public java.lang.String serializeAsString(int page)
                                   throws java.lang.Exception
Serialize this page as a String (probably for use within a test or for human evaluation.)

java.lang.Exception
See Also:
serialize(int)

serializeAsNode

public org.w3c.dom.Node serializeAsNode(int page)
                                 throws java.lang.Exception
Serialize this page as a W3C DOM Node (probably for use within Xalan)

java.lang.Exception
See Also:
serialize(int)

serializeAsDocument

public org.w3c.dom.Document serializeAsDocument(int page)
                                         throws java.lang.Exception
java.lang.Exception

getProvider

public SearchProvider getProvider()
Get the value of provider.


setProvider

public void setProvider(SearchProvider provider)
Set the value of provider.