001package org.apache.maven.tools.plugin.extractor; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException; 023import org.apache.maven.plugin.descriptor.MojoDescriptor; 024import org.apache.maven.tools.plugin.PluginToolsRequest; 025 026import java.util.List; 027 028/** 029 * @author jdcasey 030 */ 031public interface MojoDescriptorExtractor 032{ 033 /** 034 * Returns the "name" (id) of the extractor. 035 * 036 * @since TBD 037 */ 038 String getName(); 039 040 /** 041 * Returns {@code true} if extractor is deprecated. 042 * 043 * @since TBD 044 */ 045 boolean isDeprecated(); 046 047 /** 048 * Returns the {@link GroupKey} of extractor, as {@link org.apache.maven.tools.plugin.scanner.MojoScanner} will 049 * execute them grouped, and ordered within groups. Must never return {@code null}. 050 * 051 * @since TBD 052 */ 053 GroupKey getGroupKey(); 054 055 /** 056 * Execute the mojo extraction. 057 * 058 * @param request The {@link PluginToolsRequest} containing information for the extraction process. 059 * @return a list of mojo descriptors. These may return HTML values for some fields. 060 * @throws ExtractionException if any 061 * @throws InvalidPluginDescriptorException if any 062 * @since 2.5 063 */ 064 List<MojoDescriptor> execute( PluginToolsRequest request ) 065 throws ExtractionException, InvalidPluginDescriptorException; 066}