org.apache.maven.index.creator
Class JarFileContentsIndexCreator

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.index.creator.AbstractIndexCreator
          extended by org.apache.maven.index.creator.JarFileContentsIndexCreator
All Implemented Interfaces:
IndexCreator, LegacyDocumentUpdater, org.codehaus.plexus.logging.LogEnabled

@Component(role=IndexCreator.class,
           hint="jarContent")
public class JarFileContentsIndexCreator
extends AbstractIndexCreator
implements LegacyDocumentUpdater

An index creator used to index Java class names from a Maven artifact (JAR or WAR for now). Will open up the file and collect all the class names from it.


Field Summary
static IndexerField FLD_CLASSNAMES
           
static IndexerField FLD_CLASSNAMES_KW
          NexusAnalyzer makes exception with this field only, to keep backward compatibility with old consumers of nexus-indexer.
static String ID
           
 
Constructor Summary
JarFileContentsIndexCreator()
           
 
Method Summary
 Collection<IndexerField> getIndexerFields()
          Returns the indexer fields that this IndexCreator introduces to index.
 void populateArtifactInfo(ArtifactContext artifactContext)
          Populate an ArtifactContext with information about corresponding artifact.
 String toString()
           
 boolean updateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo artifactInfo)
          Update an ArtifactInfo from given Lucene Document.
 void updateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
          Update Lucene Document from a given ArtifactInfo.
 void updateLegacyDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
          Update a legacy Lucene Document from the ArtifactInfo.
 
Methods inherited from class org.apache.maven.index.creator.AbstractIndexCreator
bos, getCreatorDependencies, getId, sob
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values

FLD_CLASSNAMES

public static final IndexerField FLD_CLASSNAMES

FLD_CLASSNAMES_KW

public static final IndexerField FLD_CLASSNAMES_KW
NexusAnalyzer makes exception with this field only, to keep backward compatibility with old consumers of nexus-indexer. This field is here for "backward" compat only! The order is important too! FLD_CLASSNAMES must be registered BEFORE FLD_CLASSNAMES_KW!

Constructor Detail

JarFileContentsIndexCreator

public JarFileContentsIndexCreator()
Method Detail

populateArtifactInfo

public void populateArtifactInfo(ArtifactContext artifactContext)
                          throws IOException
Description copied from interface: IndexCreator
Populate an ArtifactContext with information about corresponding artifact.

Specified by:
populateArtifactInfo in interface IndexCreator
Throws:
IOException

updateDocument

public void updateDocument(ArtifactInfo ai,
                           org.apache.lucene.document.Document doc)
Description copied from interface: IndexCreator
Update Lucene Document from a given ArtifactInfo.

Specified by:
updateDocument in interface IndexCreator

updateLegacyDocument

public void updateLegacyDocument(ArtifactInfo ai,
                                 org.apache.lucene.document.Document doc)
Description copied from interface: LegacyDocumentUpdater
Update a legacy Lucene Document from the ArtifactInfo.

Specified by:
updateLegacyDocument in interface LegacyDocumentUpdater

updateArtifactInfo

public boolean updateArtifactInfo(org.apache.lucene.document.Document doc,
                                  ArtifactInfo artifactInfo)
Description copied from interface: IndexCreator
Update an ArtifactInfo from given Lucene Document.

Specified by:
updateArtifactInfo in interface IndexCreator
Returns:
true is artifact info has been updated

toString

public String toString()
Overrides:
toString in class Object

getIndexerFields

public Collection<IndexerField> getIndexerFields()
Description copied from interface: IndexCreator
Returns the indexer fields that this IndexCreator introduces to index.

Specified by:
getIndexerFields in interface IndexCreator
Returns:


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.