Package org.apache.maven.index.creator
Class MavenArchetypeArtifactInfoIndexCreator
- java.lang.Object
-
- org.apache.maven.index.creator.AbstractIndexCreator
-
- org.apache.maven.index.creator.MavenArchetypeArtifactInfoIndexCreator
-
- All Implemented Interfaces:
IndexCreator
@Singleton @Named("maven-archetype") public class MavenArchetypeArtifactInfoIndexCreator extends AbstractIndexCreatorA Maven Archetype index creator used to detect and correct the artifact packaging to "maven-archetype" if the inspected JAR is an Archetype. Since packaging is already handled by Minimal creator, this Creator only alters the supplied ArtifactInfo packaging field during processing, but does not interferes with Lucene document fill-up or the ArtifactInfo fill-up (the update* methods are empty).
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]ARCHETYPE_XML_LOCATIONSstatic java.lang.StringIDprivate static java.lang.StringMAVEN_ARCHETYPE_PACKAGING
-
Constructor Summary
Constructors Constructor Description MavenArchetypeArtifactInfoIndexCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckMavenArchetype(ArtifactInfo ai, java.io.File artifact)Archetypes that are added will have their packaging types set correctly (to maven-archetype)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.-
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
-
MAVEN_ARCHETYPE_PACKAGING
private static final java.lang.String MAVEN_ARCHETYPE_PACKAGING
- See Also:
- Constant Field Values
-
ARCHETYPE_XML_LOCATIONS
private static final java.lang.String[] ARCHETYPE_XML_LOCATIONS
-
-
Method Detail
-
populateArtifactInfo
public void populateArtifactInfo(ArtifactContext ac)
Description copied from interface:IndexCreatorPopulate anArtifactContextwith information about corresponding artifact.
-
checkMavenArchetype
private void checkMavenArchetype(ArtifactInfo ai, java.io.File artifact)
Archetypes that are added will have their packaging types set correctly (to maven-archetype)- Parameters:
ai-artifact-
-
updateDocument
public void updateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Description copied from interface:IndexCreatorUpdate LuceneDocumentfrom a givenArtifactInfo.
-
updateArtifactInfo
public boolean updateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo ai)Description copied from interface:IndexCreatorUpdate anArtifactInfofrom given LuceneDocument.- 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.- Returns:
-
-