Package org.tentackle.buildsupport
Class AnnotationProcessingHelper
java.lang.Object
org.tentackle.buildsupport.AnnotationProcessingHelper
Helper for annotation processing.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisModifierSet(Modifier modifier, Modifier[] modifierList) Checks if a modifier is in the set of modifiers.static booleanisTypeInstanceOf(ProcessingEnvironment processingEnv, TypeMirror typeMirror, String className) Checks whether a type is a given instance of a class.static booleanisTypeInstanceOf(ProcessingEnvironment processingEnv, TypeMirror typeMirror, String className, String genType) Checks whether a type is an instance of a given classname and optional generics type.static StringobjectArrayToString(Object[] objArray, String separator) Creates a string from an object array.static Modifier[]readModifiers(StringTokenizer stok) Gets an array of modifiers from a string tokenizer.
-
Method Details
-
readModifiers
Gets an array of modifiers from a string tokenizer.- Parameters:
stok- the string tokenizer- Returns:
- the modifier array
-
isModifierSet
Checks if a modifier is in the set of modifiers.- Parameters:
modifier- the modifier to checkmodifierList- the list of modifiers- Returns:
- true if modifier is in the list of modifiers
-
objectArrayToString
Creates a string from an object array. Copied from StringHelper to keep dependencies small.- Parameters:
objArray- the array of objectsseparator- the string between two objects- Returns:
- the object array string
-
isTypeInstanceOf
public static boolean isTypeInstanceOf(ProcessingEnvironment processingEnv, TypeMirror typeMirror, String className, String genType) Checks whether a type is an instance of a given classname and optional generics type.- Parameters:
processingEnv- the annotation processing environmenttypeMirror- the element typeclassName- the class to checkgenType- the generic type- Returns:
- true if type is an instance of a given classname
-
isTypeInstanceOf
public static boolean isTypeInstanceOf(ProcessingEnvironment processingEnv, TypeMirror typeMirror, String className) Checks whether a type is a given instance of a class.- Parameters:
processingEnv- the annotation processing environmenttypeMirror- the element typeclassName- the class to check- Returns:
- true if the typeMirror represents an instance of className
-