Package org.glassfish.hk2.stub.generator
Class StubProcessor
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.glassfish.hk2.stub.generator.StubProcessor
- All Implemented Interfaces:
Processor
@SupportedAnnotationTypes("org.glassfish.hk2.utilities.Stub")
public class StubProcessor
extends AbstractProcessor
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
private static final String
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
arrayTypeToString
(ArrayType arrayType, boolean varArgs, Map<String, String> typeMapper) private void
getAllGenericMappings
(TypeElement clazz, Map<String, Map<String, String>> retVal, Map<String, String> subclassMap) private String
private static String
getJustClassPart
(String fullyQualifiedFileNameWithDots) Gets rid of warnings and this code should work with all source versionsprivate static String
getTypeName
(TypeMirror mirror) private static String
getTypeName
(TypeMirror mirror, Map<String, String> typeMap) private static boolean
hasTypeParameters
(TypeElement clazz) private static boolean
isScopeAnnotation
(AnnotationMirror annotation) boolean
process
(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) private StubProcessor.TypeMirrorOutputs
typeMirrorToString
(TypeMirror mirror, boolean varArg, Map<String, String> typeMap) private void
writeAbstractMethod
(ExecutableElement abstractMethod, Map<String, Map<String, String>> genericMapper, Writer writer, boolean exceptions) private void
writeJavaFile
(TypeElement clazz, Set<ExecutableElement> abstractMethods, String name, boolean exceptions, List<TypeElement> contractsProvided, String scope, Map<String, Map<String, String>> genericMapper) private void
writeStub
(TypeElement clazz) Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, init, isInitialized
-
Field Details
-
NAMED_ANNO
-
EXCEPTIONS
- See Also:
-
PROVIDED_ANNO
-
STUB_EXTENSION
- See Also:
-
-
Constructor Details
-
StubProcessor
public StubProcessor()
-
-
Method Details
-
getSupportedSourceVersion
Gets rid of warnings and this code should work with all source versions- Specified by:
getSupportedSourceVersion
in interfaceProcessor
- Overrides:
getSupportedSourceVersion
in classAbstractProcessor
-
process
- Specified by:
process
in interfaceProcessor
- Specified by:
process
in classAbstractProcessor
-
isScopeAnnotation
-
getAllGenericMappings
-
hasTypeParameters
-
writeStub
- Throws:
IOException
-
getFullyQualifiedStubName
-
getJustClassPart
-
writeJavaFile
private void writeJavaFile(TypeElement clazz, Set<ExecutableElement> abstractMethods, String name, boolean exceptions, List<TypeElement> contractsProvided, String scope, Map<String, Map<String, throws IOExceptionString>> genericMapper) - Throws:
IOException
-
writeAbstractMethod
private void writeAbstractMethod(ExecutableElement abstractMethod, Map<String, Map<String, throws IOExceptionString>> genericMapper, Writer writer, boolean exceptions) - Throws:
IOException
-
typeMirrorToString
private StubProcessor.TypeMirrorOutputs typeMirrorToString(TypeMirror mirror, boolean varArg, Map<String, String> typeMap) throws IOException- Throws:
IOException
-
arrayTypeToString
private String arrayTypeToString(ArrayType arrayType, boolean varArgs, Map<String, String> typeMapper) throws IOException- Throws:
IOException
-
getTypeName
-
getTypeName
-