Package org.tentackle.buildsupport
Class AnnotationProcessingHelper
- java.lang.Object
-
- org.tentackle.buildsupport.AnnotationProcessingHelper
-
public final class AnnotationProcessingHelper extends java.lang.ObjectHelper for annotation processing.- Author:
- harald
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisModifierSet(javax.lang.model.element.Modifier modifier, javax.lang.model.element.Modifier[] modifierList)Checks if a modifier is in the set of modifiers.static booleanisTypeInstanceoOf(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.type.TypeMirror typeMirror, java.lang.String className)Checks whether a type is a given instance of a class.static booleanisTypeInstanceoOf(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.type.TypeMirror typeMirror, java.lang.String className, java.lang.String genType)Checks whether a type is an instance of of a given classname and optional generics type.static java.lang.StringobjectArrayToString(java.lang.Object[] objArray, java.lang.String separator)Creates a string from an object array.static javax.lang.model.element.Modifier[]readModifiers(java.util.StringTokenizer stok)Gets an array of modifiers from a string tokenizer.
-
-
-
Method Detail
-
readModifiers
public static javax.lang.model.element.Modifier[] readModifiers(java.util.StringTokenizer stok)
Gets an array of modifiers from a string tokenizer.- Parameters:
stok- the string tokenizer- Returns:
- the modifier array
-
isModifierSet
public static boolean isModifierSet(javax.lang.model.element.Modifier modifier, javax.lang.model.element.Modifier[] modifierList)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
public static java.lang.String objectArrayToString(java.lang.Object[] objArray, java.lang.String separator)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
-
isTypeInstanceoOf
public static boolean isTypeInstanceoOf(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.type.TypeMirror typeMirror, java.lang.String className, java.lang.String genType)Checks whether a type is an instance of 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 of a given classname
-
isTypeInstanceoOf
public static boolean isTypeInstanceoOf(javax.annotation.processing.ProcessingEnvironment processingEnv, javax.lang.model.type.TypeMirror typeMirror, java.lang.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
-
-