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 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
Fields Modifier and Type Field Description 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 java.lang.String
ID
-
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.void
populateArtifactInfo(ArtifactContext artifactContext)
Populate anArtifactContext
with information about corresponding artifact.java.lang.String
toString()
boolean
updateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo artifactInfo)
Update anArtifactInfo
from given LuceneDocument
.private void
updateArtifactInfo(ArtifactInfo ai, java.io.File f)
private void
updateArtifactInfo(ArtifactInfo ai, java.io.File f, java.lang.String strippedPrefix)
void
updateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Update LuceneDocument
from a givenArtifactInfo
.void
updateLegacyDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Update a legacy LuceneDocument
from 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:IndexCreator
Populate anArtifactContext
with information about corresponding artifact.- Specified by:
populateArtifactInfo
in interfaceIndexCreator
- Throws:
java.io.IOException
-
updateDocument
public void updateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Description copied from interface:IndexCreator
Update LuceneDocument
from a givenArtifactInfo
.- Specified by:
updateDocument
in interfaceIndexCreator
-
updateLegacyDocument
public void updateLegacyDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Description copied from interface:LegacyDocumentUpdater
Update a legacy LuceneDocument
from theArtifactInfo
.- Specified by:
updateLegacyDocument
in interfaceLegacyDocumentUpdater
-
updateArtifactInfo
public boolean updateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo artifactInfo)
Description copied from interface:IndexCreator
Update anArtifactInfo
from given LuceneDocument
.- Specified by:
updateArtifactInfo
in 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:
toString
in classjava.lang.Object
-
getIndexerFields
public java.util.Collection<IndexerField> getIndexerFields()
Description copied from interface:IndexCreator
Returns the indexer fields that this IndexCreator introduces to index.- Specified by:
getIndexerFields
in interfaceIndexCreator
- Returns:
-
-