Class ProcessorUtils
java.lang.Object
io.avaje.inject.generator.ProcessorUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringboxedPrimitive(String type) Returns boxed type if type string is primitive, otherwise return the input unchangedstatic StringcommonParent(String firstPkg, String secondPkg) Return the common parent package between two classes/packages.static StringGet the enclosed type from a nested class, or return the type itself if not nested.static booleanhasAnnotationWithName(Element element, String simpleName) Check if element has an annotation with a simple name that matches the given short namestatic booleanisPrimitive(String type) Return true if type string is of a primitive typestatic booleanisVarArg(VariableElement element, int position) Determine if a VariableElement is a varargs parameterstatic StringGet Package from a given fqn stringstatic StringsanitizeImports(String input) Sanitize an import string to remove invalid charactersstatic StringGet short type from a given fqn string.static StringtrimAnnotations(String input) Remove all annotations and their values from a string.
-
Method Details
-
boxedPrimitive
-
isPrimitive
Return true if type string is of a primitive type- Parameters:
type-- Returns:
- true if type represents a primitive
-
packageOf
-
shortType
-
trimAnnotations
-
commonParent
-
isVarArg
Determine if a VariableElement is a varargs parameter- Parameters:
element- the parameter elementposition- the position of the parameter in the signature- Returns:
- true if element is a varargs parameter, false otherwise
-
hasAnnotationWithName
Check if element has an annotation with a simple name that matches the given short name- Parameters:
element- element to checksimpleName- the simple name of the target annotation- Returns:
- true if a matching annotation is present
-
sanitizeImports
-
extractEnclosingFQN
-