pax_global_header 0000666 0000000 0000000 00000000064 12653341163 0014516 g ustar 00root root 0000000 0000000 52 comment=7a5ebfe3b7f27157f0a0c468da34aaae23d4a0de
metainf-services-metainf-services-1.7/ 0000775 0000000 0000000 00000000000 12653341163 0020073 5 ustar 00root root 0000000 0000000 metainf-services-metainf-services-1.7/.gitignore 0000664 0000000 0000000 00000000010 12653341163 0022052 0 ustar 00root root 0000000 0000000 /target/ metainf-services-metainf-services-1.7/pom.xml 0000664 0000000 0000000 00000005025 12653341163 0021412 0 ustar 00root root 0000000 0000000
* If the class for which this annotation is placaed only have one base class or one interface, * then the CONTRACTNAME is the fully qualified name of that type. * *
* Otherwise, the {@link #value()} element is required to specify the contract type name.
*
* @author Kohsuke Kawaguchi
*/
@Retention(SOURCE)
@Documented
@Target(TYPE)
public @interface MetaInfServices {
Class>[] value() default void.class;
}
metainf-services-metainf-services-1.7/src/main/java/org/kohsuke/metainf_services/ 0000775 0000000 0000000 00000000000 12653341163 0030315 5 ustar 00root root 0000000 0000000 AnnotationProcessorImpl.java 0000664 0000000 0000000 00000017773 12653341163 0035754 0 ustar 00root root 0000000 0000000 metainf-services-metainf-services-1.7/src/main/java/org/kohsuke/metainf_services /*
* The MIT License
*
* Copyright (c) 2009-, Kohsuke Kawaguchi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.kohsuke.metainf_services;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Filer;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.SourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.MirroredTypesException;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.tools.Diagnostic.Kind;
import javax.tools.FileObject;
import javax.tools.StandardLocation;
import org.kohsuke.MetaInfServices;
/**
* @author Kohsuke Kawaguchi
*/
@SuppressWarnings({"Since15"})
@SupportedAnnotationTypes("org.kohsuke.MetaInfServices")
public class AnnotationProcessorImpl extends AbstractProcessor {
@Override public SourceVersion getSupportedSourceVersion() {
try {
// Seems to work. Probably could use some additional error checks, but current code does not even verify that the class is assignable to an explicitly specified type!
// Need to add unit tests. See stapler/stapler/core/src/test/java/org/kohsuke/stapler/jsr269/ for examples.
return SourceVersion.valueOf("RELEASE_8");
} catch (IllegalArgumentException x) {}
try {
return SourceVersion.valueOf("RELEASE_7");
} catch (IllegalArgumentException x) {}
return SourceVersion.RELEASE_6;
}
@Override
public boolean process(Set extends TypeElement> annotations, RoundEnvironment roundEnv) {
if (roundEnv.processingOver()) return false;
// TODO should not write anything until processingOver
Map