Regain 2.1.0-STABLE API

net.sf.regain.crawler.preparator
Class JavaPreparator

java.lang.Object
  extended by net.sf.regain.crawler.document.AbstractPreparator
      extended by net.sf.regain.crawler.preparator.JavaPreparator
All Implemented Interfaces:
Pluggable, Preparator, WriteablePreparator

public class JavaPreparator
extends AbstractPreparator

Prepares Java source code for indexing

The following information will be extracted: class name, member names, return types , code blocks

Author:
Thomas Tesche, cluster:Consult, http://www.thtesche.com/

Field Summary
 
Fields inherited from interface net.sf.regain.crawler.document.Preparator
DEFAULT_BUFFER_SIZE
 
Constructor Summary
JavaPreparator()
          Creates a new instance of JavaPreparator.
 
Method Summary
private  StringBuffer extractClassInfo(JClassEnum cls, boolean innerClass)
          Extract different information from a class.
private  StringBuffer extractComments(JavaParser parser)
           
private  StringBuffer extractEnumInfo(JClassEnum cls)
          Extract constants info from Enums.
private  StringBuffer extractImportDeclarations(JavaParser parser)
           
private  StringBuffer extractMethodInfo(JClassEnum cls)
          Extract method details for the class.
 void prepare(RawDocument rawDocument)
          Prepares the document for indexing
 
Methods inherited from class net.sf.regain.crawler.document.AbstractPreparator
accepts, addAdditionalField, cleanUp, close, concatenateStringParts, getAdditionalFields, getCleanedContent, getCleanedMetaData, getHeadlines, getPath, getPriority, getSummary, getTitle, init, setCleanedContent, setCleanedMetaData, setHeadlines, setPath, setPriority, setSummary, setTitle, setUrlRegex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaPreparator

public JavaPreparator()
               throws RegainException
Creates a new instance of JavaPreparator.

Throws:
RegainException - If creating the preparator failed.
Method Detail

prepare

public void prepare(RawDocument rawDocument)
             throws RegainException
Prepares the document for indexing

Parameters:
rawDocument - the document
Throws:
RegainException - if preparation goes wrong

extractClassInfo

private StringBuffer extractClassInfo(JClassEnum cls,
                                      boolean innerClass)
Extract different information from a class.

Parameters:
cls - - the class from which the infos will be extracted
innerClass - - is the class an inner class
Returns:
the extracted infos as a StringBuffer

extractEnumInfo

private StringBuffer extractEnumInfo(JClassEnum cls)
Extract constants info from Enums.

Parameters:
the - enum to examine
Returns:
the result as a StringBuffer

extractMethodInfo

private StringBuffer extractMethodInfo(JClassEnum cls)
Extract method details for the class.

Parameters:
the - class to examine
Returns:
the result as a StringBuffer

extractImportDeclarations

private StringBuffer extractImportDeclarations(JavaParser parser)

extractComments

private StringBuffer extractComments(JavaParser parser)

Regain 2.1.0-STABLE API

Regain 2.1.0-STABLE, Copyright (C) 2004-2010 Til Schneider, www.murfman.de, Thomas Tesche, www.clustersystems.info