RichFaces CDK Generator 4.2.0.CR1

org.richfaces.cdk.apt
Interface SourceUtils

All Known Implementing Classes:
AptSourceUtils, ReflectionUtils

public interface SourceUtils

This class provides utility methods to analayze java classes. This implementation uses APT API to get information about Java code.

Author:
asmirnov@exadel.com

Nested Class Summary
static class SourceUtils.ACCESS_TYPE
           
static interface SourceUtils.BeanProperty
          

static interface SourceUtils.SuperTypeVisitor
          

 
Method Summary
 TypeElement asTypeElement(TypeMirror mirror)
          

Converts TypeMirror into corresponding TypeElement

 Set<SourceUtils.BeanProperty> getAbstractBeanProperties(TypeElement type)
          

 AnnotationMirror getAnnotationMirror(Element element, Class<? extends Annotation> annotationType)
          

Get model representation of the annotation for given model element

<T> T
getAnnotationValue(AnnotationMirror annotation, String propertyName, Class<T> expectedType)
          

<T> Iterable<T>
getAnnotationValues(AnnotationMirror annotation, String propertyName, Class<T> expectedType)
          

 Set<SourceUtils.BeanProperty> getBeanPropertiesAnnotatedWith(Class<? extends Annotation> annotation, TypeElement type)
          

Get all fields and bean properties that are annotated with given annotation.

 SourceUtils.BeanProperty getBeanProperty(ClassName type, String name)
          

Get bean property descriptor for particular type.

 SourceUtils.BeanProperty getBeanProperty(TypeElement type, String name)
          

Get bean property descriptor for particular type.

 Object getConstant(TypeElement element, String name)
          

 String getDocComment(Element element)
          

Get JavaDoc comments associated with given element.

 boolean isAnnotationPresent(Element element, Class<? extends Annotation> annotationType)
          

Check model element for presense of annotation.

 boolean isAnnotationPropertyPresent(AnnotationMirror annotation, String propertyName)
          

 boolean isClassExists(ClassName type)
          

 boolean isDefaultValue(AnnotationMirror annotation, String propertyName)
          

Check annotation proprrty for default value.

 void setModelProperty(Object model, AnnotationMirror annotation, String modelProperty)
          

 void setModelProperty(Object model, AnnotationMirror annotation, String modelProperty, String annotationAttribute)
          

 void visitSupertypes(TypeElement type, SourceUtils.SuperTypeVisitor visitor)
          

 

Method Detail

getBeanPropertiesAnnotatedWith

Set<SourceUtils.BeanProperty> getBeanPropertiesAnnotatedWith(Class<? extends Annotation> annotation,
                                                             TypeElement type)

Get all fields and bean properties that are annotated with given annotation.

Parameters:
annotation -
type -
Returns:

getAbstractBeanProperties

Set<SourceUtils.BeanProperty> getAbstractBeanProperties(TypeElement type)

Parameters:
type -
Returns:

getBeanProperty

SourceUtils.BeanProperty getBeanProperty(TypeElement type,
                                         String name)

Get bean property descriptor for particular type.

Parameters:
type -
name -
Returns:

getBeanProperty

SourceUtils.BeanProperty getBeanProperty(ClassName type,
                                         String name)

Get bean property descriptor for particular type.

Parameters:
type -
name -
Returns:

getDocComment

String getDocComment(Element element)

Get JavaDoc comments associated with given element.

Parameters:
componentElement -
Returns:

isAnnotationPresent

boolean isAnnotationPresent(Element element,
                            Class<? extends Annotation> annotationType)

Check model element for presense of annotation.

Parameters:
element -
annotationType -
Returns:

getAnnotationMirror

AnnotationMirror getAnnotationMirror(Element element,
                                     Class<? extends Annotation> annotationType)

Get model representation of the annotation for given model element

Parameters:
annotationType -
Returns:

getAnnotationValue

<T> T getAnnotationValue(AnnotationMirror annotation,
                         String propertyName,
                         Class<T> expectedType)

Parameters:
annotation -
propertyName -
Returns:

getAnnotationValues

<T> Iterable<T> getAnnotationValues(AnnotationMirror annotation,
                                    String propertyName,
                                    Class<T> expectedType)

Parameters:
annotation -
propertyName -
Returns:

isAnnotationPropertyPresent

boolean isAnnotationPropertyPresent(AnnotationMirror annotation,
                                    String propertyName)

Parameters:
annotation -
propertyName -
Returns:

isDefaultValue

boolean isDefaultValue(AnnotationMirror annotation,
                       String propertyName)

Check annotation proprrty for default value.

Parameters:
annotation -
propertyName -
Returns:
true if property has its default value.

setModelProperty

void setModelProperty(Object model,
                      AnnotationMirror annotation,
                      String modelProperty,
                      String annotationAttribute)

Parameters:
model -
annotation -
modelProperty -
annotationAttribute -

setModelProperty

void setModelProperty(Object model,
                      AnnotationMirror annotation,
                      String modelProperty)

Parameters:
model -
annotation -
modelProperty -

getConstant

Object getConstant(TypeElement element,
                   String name)

Parameters:
componentElement -
name -
Returns:

visitSupertypes

void visitSupertypes(TypeElement type,
                     SourceUtils.SuperTypeVisitor visitor)

Parameters:
type -
visitor -

asTypeElement

TypeElement asTypeElement(TypeMirror mirror)

Converts TypeMirror into corresponding TypeElement

Parameters:
mirror -
Returns:
The Element for given type

isClassExists

boolean isClassExists(ClassName type)

Parameters:
type -
Returns:
true if class already exist in project source or dependent libraries.

RichFaces CDK Generator 4.2.0.CR1

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.