|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.util.AnnotationProcessorUtils
public class AnnotationProcessorUtils
Series of method to aid in the writing of annotation processors.
| Nested Class Summary | |
|---|---|
static class |
AnnotationProcessorUtils.TypeCategory
|
| Constructor Summary | |
|---|---|
AnnotationProcessorUtils()
|
|
| Method Summary | |
|---|---|
static javax.lang.model.type.TypeMirror |
getDeclaredType(javax.lang.model.element.Element elem)
Accessor for the declared type of this element. |
static java.lang.String |
getDeclaredTypeName(javax.annotation.processing.ProcessingEnvironment processingEnv,
javax.lang.model.type.TypeMirror type,
boolean box)
Method to return the declared type name of the provided TypeMirror. |
static java.util.List<? extends javax.lang.model.element.Element> |
getFieldMembers(javax.lang.model.element.TypeElement el)
Convenience accessor for all field members of the supplied type element. |
static java.lang.String |
getMemberName(javax.lang.model.element.Element el)
Accessor for the member name for a field or Java bean getter/setter. |
static java.util.List<? extends javax.lang.model.element.Element> |
getPropertyMembers(javax.lang.model.element.TypeElement el)
Convenience accessor for all property members of the supplied type element. |
static AnnotationProcessorUtils.TypeCategory |
getTypeCategoryForTypeMirror(java.lang.String typeName)
Method to return the JPA2 type category for a type. |
static java.lang.Object |
getValueForAnnotationAttribute(javax.lang.model.element.Element elem,
java.lang.Class annotCls,
java.lang.String attribute)
Accessor for the value for an annotation attribute. |
static boolean |
isJavaBeanGetter(javax.lang.model.element.ExecutableElement method)
Convenience method to return if the provided method is a java bean getter. |
static boolean |
isJavaBeanSetter(javax.lang.model.element.ExecutableElement method)
Convenience method to return if the provided method is a java bean setter. |
static boolean |
isMethod(javax.lang.model.element.Element elem)
Convenience method to return if the provided element represents a method (otherwise a field). |
static boolean |
returnsBoolean(javax.lang.model.element.ExecutableElement method)
Convenience method returning if the provided method returns boolean. |
static boolean |
returnsVoid(javax.lang.model.element.ExecutableElement method)
Convenience method returning if the provided method returns void. |
static boolean |
typeIsPrimitive(javax.lang.model.type.TypeMirror type)
Convenience method to return if the provided type is a primitive. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotationProcessorUtils()
| Method Detail |
|---|
public static AnnotationProcessorUtils.TypeCategory getTypeCategoryForTypeMirror(java.lang.String typeName)
typeName - The type name (e.g java.lang.String, java.util.Collection)
public static java.util.List<? extends javax.lang.model.element.Element> getFieldMembers(javax.lang.model.element.TypeElement el)
el - The type element
public static java.util.List<? extends javax.lang.model.element.Element> getPropertyMembers(javax.lang.model.element.TypeElement el)
el - The type element
public static boolean isJavaBeanGetter(javax.lang.model.element.ExecutableElement method)
method - The method
public static java.lang.String getMemberName(javax.lang.model.element.Element el)
el - The element
public static boolean isJavaBeanSetter(javax.lang.model.element.ExecutableElement method)
method - The method
public static boolean isMethod(javax.lang.model.element.Element elem)
elem - The element
public static javax.lang.model.type.TypeMirror getDeclaredType(javax.lang.model.element.Element elem)
elem - The element
public static java.lang.Object getValueForAnnotationAttribute(javax.lang.model.element.Element elem,
java.lang.Class annotCls,
java.lang.String attribute)
elem - The elementannotCls - Annotation classattribute - The attribute we're interested in
public static boolean returnsVoid(javax.lang.model.element.ExecutableElement method)
method - The method
public static boolean returnsBoolean(javax.lang.model.element.ExecutableElement method)
method - The method
public static boolean typeIsPrimitive(javax.lang.model.type.TypeMirror type)
type - The type
public static java.lang.String getDeclaredTypeName(javax.annotation.processing.ProcessingEnvironment processingEnv,
javax.lang.model.type.TypeMirror type,
boolean box)
processingEnv - Processing environmenttype - The type (mirror)box - Whether to (auto)box this type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||