Package org.apache.maven.index.creator
Class JarFileContentsIndexCreator
- java.lang.Object
-
- org.apache.maven.index.creator.AbstractIndexCreator
-
- org.apache.maven.index.creator.JarFileContentsIndexCreator
-
- All Implemented Interfaces:
IndexCreator,LegacyDocumentUpdater
@Singleton @Named("jarContent") public class JarFileContentsIndexCreator extends AbstractIndexCreator implements LegacyDocumentUpdaterAn 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
Fields Modifier and Type Field Description static IndexerFieldFLD_CLASSNAMESstatic IndexerFieldFLD_CLASSNAMES_KWNexusAnalyzer makes exception with this field only, to keep backward compatibility with old consumers of nexus-indexer.static java.lang.StringID
-
Constructor Summary
Constructors Constructor Description JarFileContentsIndexCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<IndexerField>getIndexerFields()Returns the indexer fields that this IndexCreator introduces to index.voidpopulateArtifactInfo(ArtifactContext artifactContext)Populate anArtifactContextwith information about corresponding artifact.java.lang.StringtoString()booleanupdateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo artifactInfo)Update anArtifactInfofrom given LuceneDocument.private voidupdateArtifactInfo(ArtifactInfo ai, java.io.File f)private voidupdateArtifactInfo(ArtifactInfo ai, java.io.File f, java.lang.String strippedPrefix)voidupdateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)Update LuceneDocumentfrom a givenArtifactInfo.voidupdateLegacyDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)Update a legacy LuceneDocumentfrom theArtifactInfo.-
Methods inherited from class org.apache.maven.index.creator.AbstractIndexCreator
bos, getCreatorDependencies, getId, getLogger, sob
-
-
-
-
Field Detail
-
ID
public static final java.lang.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!
-
-
Method Detail
-
populateArtifactInfo
public void populateArtifactInfo(ArtifactContext artifactContext) throws java.io.IOException
Description copied from interface:IndexCreatorPopulate anArtifactContextwith information about corresponding artifact.- Specified by:
populateArtifactInfoin interfaceIndexCreator- Throws:
java.io.IOException
-
updateDocument
public void updateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Description copied from interface:IndexCreatorUpdate LuceneDocumentfrom a givenArtifactInfo.- Specified by:
updateDocumentin interfaceIndexCreator
-
updateLegacyDocument
public void updateLegacyDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Description copied from interface:LegacyDocumentUpdaterUpdate a legacy LuceneDocumentfrom theArtifactInfo.- Specified by:
updateLegacyDocumentin interfaceLegacyDocumentUpdater
-
updateArtifactInfo
public boolean updateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo artifactInfo)Description copied from interface:IndexCreatorUpdate anArtifactInfofrom given LuceneDocument.- Specified by:
updateArtifactInfoin interfaceIndexCreator- Returns:
- true is artifact info has been updated
-
updateArtifactInfo
private void updateArtifactInfo(ArtifactInfo ai, java.io.File f) throws java.io.IOException
- Throws:
java.io.IOException
-
updateArtifactInfo
private void updateArtifactInfo(ArtifactInfo ai, java.io.File f, java.lang.String strippedPrefix) throws java.io.IOException
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getIndexerFields
public java.util.Collection<IndexerField> getIndexerFields()
Description copied from interface:IndexCreatorReturns the indexer fields that this IndexCreator introduces to index.- Specified by:
getIndexerFieldsin interfaceIndexCreator- Returns:
-
-