Package org.apache.maven.index.creator
Class MinimalArtifactInfoIndexCreator
- java.lang.Object
-
- org.apache.maven.index.creator.AbstractIndexCreator
-
- org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator
-
- All Implemented Interfaces:
IndexCreator,LegacyDocumentUpdater
@Singleton @Named("min") public class MinimalArtifactInfoIndexCreator extends AbstractIndexCreator implements LegacyDocumentUpdaterA minimal index creator used to provide basic information about Maven artifact. This creator will create the index fast, will not open any file to be fastest as possible but it has some drawbacks: The information gathered by this creator are sometimes based on "best-effort" only, and does not reflect the reality (ie. maven archetype packaging @seeMavenArchetypeArtifactInfoIndexCreator).
-
-
Field Summary
Fields Modifier and Type Field Description static IndexerFieldFLD_ARTIFACT_IDstatic IndexerFieldFLD_ARTIFACT_ID_KWstatic IndexerFieldFLD_CLASSIFIERstatic IndexerFieldFLD_DESCRIPTIONstatic IndexerFieldFLD_EXTENSIONstatic IndexerFieldFLD_GROUP_IDstatic IndexerFieldFLD_GROUP_ID_KWstatic IndexerFieldFLD_INFOInfo: packaging, lastModified, size, sourcesExists, javadocExists, signatureExists.static IndexerFieldFLD_LAST_MODIFIEDstatic IndexerFieldFLD_NAMEstatic IndexerFieldFLD_PACKAGINGstatic IndexerFieldFLD_SHA1static IndexerFieldFLD_VERSIONstatic IndexerFieldFLD_VERSION_KWstatic java.lang.StringIDprivate Locatorjlprivate Locatorsha1lprivate Locatorsiglprivate Locatorsl
-
Constructor Summary
Constructors Constructor Description MinimalArtifactInfoIndexCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringgetExtension(java.io.File artifact, Gav gav)java.util.Collection<IndexerField>getIndexerFields()Returns the indexer fields that this IndexCreator introduces to index.voidpopulateArtifactInfo(ArtifactContext ac)Populate anArtifactContextwith information about corresponding artifact.java.lang.StringtoString()booleanupdateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo ai)Update anArtifactInfofrom given LuceneDocument.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_INFO
public static final IndexerField FLD_INFO
Info: packaging, lastModified, size, sourcesExists, javadocExists, signatureExists. Stored, not indexed.
-
FLD_GROUP_ID_KW
public static final IndexerField FLD_GROUP_ID_KW
-
FLD_GROUP_ID
public static final IndexerField FLD_GROUP_ID
-
FLD_ARTIFACT_ID_KW
public static final IndexerField FLD_ARTIFACT_ID_KW
-
FLD_ARTIFACT_ID
public static final IndexerField FLD_ARTIFACT_ID
-
FLD_VERSION_KW
public static final IndexerField FLD_VERSION_KW
-
FLD_VERSION
public static final IndexerField FLD_VERSION
-
FLD_PACKAGING
public static final IndexerField FLD_PACKAGING
-
FLD_EXTENSION
public static final IndexerField FLD_EXTENSION
-
FLD_CLASSIFIER
public static final IndexerField FLD_CLASSIFIER
-
FLD_NAME
public static final IndexerField FLD_NAME
-
FLD_DESCRIPTION
public static final IndexerField FLD_DESCRIPTION
-
FLD_LAST_MODIFIED
public static final IndexerField FLD_LAST_MODIFIED
-
FLD_SHA1
public static final IndexerField FLD_SHA1
-
jl
private Locator jl
-
sl
private Locator sl
-
sigl
private Locator sigl
-
sha1l
private Locator sha1l
-
-
Method Detail
-
populateArtifactInfo
public void populateArtifactInfo(ArtifactContext ac)
Description copied from interface:IndexCreatorPopulate anArtifactContextwith information about corresponding artifact.- Specified by:
populateArtifactInfoin interfaceIndexCreator
-
getExtension
private java.lang.String getExtension(java.io.File artifact, Gav gav)
-
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 ai)Description copied from interface:IndexCreatorUpdate anArtifactInfofrom given LuceneDocument.- Specified by:
updateArtifactInfoin interfaceIndexCreator- Returns:
- true is artifact info has been updated
-
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:
-
-