Modifier and Type | Field and Description |
---|---|
static Function<Element,Stream<ExecutableElement>> |
FILTER_METHOD |
static Pattern |
LINK_REFERENCE_PATTERN |
Constructor and Description |
---|
Helper() |
Modifier and Type | Method and Description |
---|---|
static String |
convertCamelCaseToUnderscores(String str) |
static String |
decapitaliseFirstLetter(String str) |
static TypeElement |
getElementTypeOf(Element elt)
Return the element type of the specified element.
|
static String |
getJavadocTag(String comment,
String tagName) |
static String |
getNonGenericType(String type) |
static String |
getPackageName(String type) |
static String |
getSimpleName(String type) |
static String |
indentString(String str,
String indent) |
static String |
normalizePropertyName(String propertyName)
Normalize a property name:
the first char will always be a lower case if the first char is an upper case, any following upper case char will be lower cased unless it is followed by a lower case char For instance: foo -> foo Foo -> foo URL -> url URLFactory -> urlFactory |
static String |
normalizeWhitespaces(String s)
Trim and normalize the whitespaces in a string: any cluster of more than one whitespace char
is replaced by a space char, then the string is trimmed.
|
static String |
removeTags(String comment) |
static Set<DeclaredType> |
resolveAncestorTypes(TypeElement typeElt,
boolean withSuper,
boolean withInterfaces)
Resolve the set of all the ancestors declared types of a given type element.
|
static AnnotationMirror |
resolveMethodAnnotation(Class<? extends Annotation> annotationType,
Elements elementUtils,
Types typeUtils,
TypeElement declaring,
ExecutableElement method)
Resolve a method annotation, this method scan the specified method, if the annotation is not found
it will also scan the methods this method overrides and return the annotation when it is found.
|
static AnnotationMirror |
resolveMethodAnnotation(DeclaredType annotationType,
Elements elementUtils,
Types typeUtils,
TypeElement declaring,
ExecutableElement method)
Resolve a method annotation, this method scan the specified method, if the annotation is not found
it will also scan the methods this method overrides and return the annotation when it is found.
|
static Element |
resolveSignature(Elements elementUtils,
Types typeUtils,
TypeElement declaringElt,
String signature)
Resolves a documentation signature, null can be returned if no element can be resolved.
|
static TypeMirror |
resolveTypeParameter(Types typeUtils,
DeclaredType subType,
TypeParameterElement typeParam)
Return the type of a type parameter element of a given type element when that type parameter
element is parameterized by a sub type, directly or indirectly.
|
static <T> Type |
resolveTypeParameter(Type type,
TypeVariable<Class<T>> typeParam)
Return the type of a type parameter element of a given type element when that type parameter
element is parameterized by a sub type, directly or indirectly.
|
public static final Function<Element,Stream<ExecutableElement>> FILTER_METHOD
public static final Pattern LINK_REFERENCE_PATTERN
public static String normalizePropertyName(String propertyName)
propertyName
- the property namepublic static AnnotationMirror resolveMethodAnnotation(Class<? extends Annotation> annotationType, Elements elementUtils, Types typeUtils, TypeElement declaring, ExecutableElement method)
annotationType
- the annotation type,elementUtils
- element utilstypeUtils
- type utilsdeclaring
- the element declaring the methodmethod
- the method to start the resolution frompublic static AnnotationMirror resolveMethodAnnotation(DeclaredType annotationType, Elements elementUtils, Types typeUtils, TypeElement declaring, ExecutableElement method)
annotationType
- the annotation type,elementUtils
- element utilstypeUtils
- type utilsdeclaring
- the element declaring the methodmethod
- the method to start the resolution frompublic static TypeMirror resolveTypeParameter(Types typeUtils, DeclaredType subType, TypeParameterElement typeParam)
typeUtils
- the type utilssubType
- the sub type for which the type parameter is parameterizedtypeParam
- the type parameter to resolvepublic static <T> Type resolveTypeParameter(Type type, TypeVariable<Class<T>> typeParam)
type
- the sub type for which the type parameter is parameterizedtypeParam
- the type parameter to resolvepublic static Element resolveSignature(Elements elementUtils, Types typeUtils, TypeElement declaringElt, String signature)
elementUtils
- the element utilstypeUtils
- the type utilsdeclaringElt
- the declaring element, may be nullsignature
- the signature to resolvepublic static TypeElement getElementTypeOf(Element elt)
elt
- the elementpublic static String normalizeWhitespaces(String s)
s
- the string to normalizepublic static Set<DeclaredType> resolveAncestorTypes(TypeElement typeElt, boolean withSuper, boolean withInterfaces)
typeElt
- the type element to resolveCopyright © 2017. All rights reserved.