|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.jpamodelgen.util.TypeUtils
public final class TypeUtils
Utility class.
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_ANNOTATION_PARAMETER_NAME
|
| Method Summary | |
|---|---|
static boolean |
containsAnnotation(javax.lang.model.element.Element element,
java.lang.Class<?>... annotations)
|
static void |
determineAccessTypeForHierarchy(javax.lang.model.element.TypeElement searchedElement,
Context context)
|
static javax.persistence.AccessType |
determineAnnotationSpecifiedAccessType(javax.lang.model.element.Element element)
|
static java.lang.String |
extractClosestRealTypeAsString(javax.lang.model.type.TypeMirror type,
Context context)
|
static javax.lang.model.element.AnnotationMirror |
getAnnotationMirror(javax.lang.model.element.Element element,
java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Checks whether the Element hosts an annotation of the specified class. |
static javax.lang.model.element.AnnotationMirror |
getAnnotationMirror(javax.lang.model.element.Element element,
java.lang.String fqcn)
Checks whether the Element hosts the annotation with the given fully qualified class name. |
static java.lang.Object |
getAnnotationValue(javax.lang.model.element.AnnotationMirror annotationMirror,
java.lang.String parameterValue)
|
static javax.lang.model.type.TypeMirror |
getCollectionElementType(javax.lang.model.type.DeclaredType t,
java.lang.String fqNameOfReturnedType,
java.lang.String explicitTargetEntityName,
Context context)
|
static javax.lang.model.element.ElementKind |
getElementKindForAccessType(javax.persistence.AccessType accessType)
|
static java.lang.String |
getKeyType(javax.lang.model.type.DeclaredType t,
Context context)
|
static javax.lang.model.element.TypeElement |
getSuperclassTypeElement(javax.lang.model.element.TypeElement element)
|
static boolean |
isAnnotationMirrorOfType(javax.lang.model.element.AnnotationMirror annotationMirror,
java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Returns true if the provided annotation type is of the same type as the provided class, false otherwise. |
static boolean |
isAnnotationMirrorOfType(javax.lang.model.element.AnnotationMirror annotationMirror,
java.lang.String fqcn)
Returns true if the provided annotation type is of the same type as the provided class, false otherwise. |
static boolean |
isTypeElementOfType(javax.lang.model.element.TypeElement element,
java.lang.Class<?> clazz)
|
static java.lang.String |
toTypeString(javax.lang.model.type.TypeMirror type)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_ANNOTATION_PARAMETER_NAME
| Method Detail |
|---|
public static java.lang.String toTypeString(javax.lang.model.type.TypeMirror type)
public static javax.lang.model.element.TypeElement getSuperclassTypeElement(javax.lang.model.element.TypeElement element)
public static java.lang.String extractClosestRealTypeAsString(javax.lang.model.type.TypeMirror type,
Context context)
public static boolean containsAnnotation(javax.lang.model.element.Element element,
java.lang.Class<?>... annotations)
public static boolean isAnnotationMirrorOfType(javax.lang.model.element.AnnotationMirror annotationMirror,
java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
true if the provided annotation type is of the same type as the provided class, false otherwise.
This method uses the string class names for comparison. See also http://www.retep.org/2009/02/getting-class-values-from-annotations.html.
annotationMirror - The annotation mirrorclazz - the class name to check against
true if the provided annotation type is of the same type as the provided class, false otherwise.
public static boolean isAnnotationMirrorOfType(javax.lang.model.element.AnnotationMirror annotationMirror,
java.lang.String fqcn)
true if the provided annotation type is of the same type as the provided class, false otherwise.
This method uses the string class names for comparison. See also http://www.retep.org/2009/02/getting-class-values-from-annotations.html.
annotationMirror - The annotation mirrorfqcn - the fully qualified class name to check against
true if the provided annotation type is of the same type as the provided class, false otherwise.
public static boolean isTypeElementOfType(javax.lang.model.element.TypeElement element,
java.lang.Class<?> clazz)
public static javax.lang.model.element.AnnotationMirror getAnnotationMirror(javax.lang.model.element.Element element,
java.lang.String fqcn)
Element hosts the annotation with the given fully qualified class name.
element - the element to check for the hosted annotationfqcn - the fully qualified class name of the annotation to check for
Element or null in case
the TypeElement does not host the specified annotation.
public static javax.lang.model.element.AnnotationMirror getAnnotationMirror(javax.lang.model.element.Element element,
java.lang.Class<? extends java.lang.annotation.Annotation> clazz)
Element hosts an annotation of the specified class.
element - the element to check for the hosted annotationclazz - the annotation class to check for
Element or null in case
the TypeElement does not host the specified annotation.
public static java.lang.Object getAnnotationValue(javax.lang.model.element.AnnotationMirror annotationMirror,
java.lang.String parameterValue)
public static void determineAccessTypeForHierarchy(javax.lang.model.element.TypeElement searchedElement,
Context context)
public static javax.lang.model.type.TypeMirror getCollectionElementType(javax.lang.model.type.DeclaredType t,
java.lang.String fqNameOfReturnedType,
java.lang.String explicitTargetEntityName,
Context context)
public static javax.persistence.AccessType determineAnnotationSpecifiedAccessType(javax.lang.model.element.Element element)
public static javax.lang.model.element.ElementKind getElementKindForAccessType(javax.persistence.AccessType accessType)
public static java.lang.String getKeyType(javax.lang.model.type.DeclaredType t,
Context context)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||