public class ModelUtils extends Object
| Constructor and Description |
|---|
ModelUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.google.common.base.Optional<AnnotationMirror> |
findAnnotationMirror(Element element,
Class<? extends Annotation> annotationClass)
Returns an
AnnotationMirror for the annotation of type annotationClass on
element, or Optional.absent() if no such annotation exists. |
static com.google.common.base.Optional<AnnotationMirror> |
findAnnotationMirror(Element element,
String annotationClassName)
Returns an
AnnotationMirror for the annotation of type annotationClassName on
element, or Optional.absent() if no such annotation exists. |
static com.google.common.base.Optional<AnnotationValue> |
findProperty(AnnotationMirror annotation,
String propertyName) |
static com.google.common.base.Optional<TypeElement> |
maybeAsTypeElement(TypeMirror type)
Returns the
TypeElement corresponding to type, if there is one. |
static com.google.common.base.Optional<DeclaredType> |
maybeDeclared(TypeMirror type)
Returns
type as a DeclaredType, if it is one. |
static com.google.common.base.Optional<TypeElement> |
maybeType(Element element)
Returns
element as a TypeElement, if it is one. |
public static com.google.common.base.Optional<AnnotationMirror> findAnnotationMirror(Element element, Class<? extends Annotation> annotationClass)
AnnotationMirror for the annotation of type annotationClass on
element, or Optional.absent() if no such annotation exists.public static com.google.common.base.Optional<AnnotationMirror> findAnnotationMirror(Element element, String annotationClassName)
AnnotationMirror for the annotation of type annotationClassName on
element, or Optional.absent() if no such annotation exists.public static com.google.common.base.Optional<AnnotationValue> findProperty(AnnotationMirror annotation, String propertyName)
public static com.google.common.base.Optional<TypeElement> maybeType(Element element)
element as a TypeElement, if it is one.public static com.google.common.base.Optional<DeclaredType> maybeDeclared(TypeMirror type)
type as a DeclaredType, if it is one.public static com.google.common.base.Optional<TypeElement> maybeAsTypeElement(TypeMirror type)
TypeElement corresponding to type, if there is one.Copyright © 2015 inferred.org. All rights reserved.