RichFaces CDK Generator 4.2.0.CR1

org.richfaces.cdk.apt
Class AptSourceUtils

java.lang.Object
  extended by org.richfaces.cdk.apt.AptSourceUtils
All Implemented Interfaces:
SourceUtils

public class AptSourceUtils
extends Object
implements SourceUtils

Implementation to use in annotation processor.

Author:
asmirnov@exadel.com

Nested Class Summary
protected  class AptSourceUtils.AptBeanProperty
          

 
Nested classes/interfaces inherited from interface org.richfaces.cdk.apt.SourceUtils
SourceUtils.ACCESS_TYPE, SourceUtils.BeanProperty, SourceUtils.SuperTypeVisitor
 
Constructor Summary
AptSourceUtils(ProcessingEnvironment processingEnv)
          

 
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 componentElement, String name)
          

 String getDocComment(Element componentElement)
          

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)
          

Set model property to the corresponding annotation attribute, if annotation attribute set to non-default value.

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

Set model property to the corresponding annotation attribute, if annotation attribute set to non-default value.

 void visitSupertypes(TypeElement type, SourceUtils.SuperTypeVisitor visitor)
          

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AptSourceUtils

public AptSourceUtils(ProcessingEnvironment processingEnv)

Parameters:
processingEnv -
Method Detail

getBeanPropertiesAnnotatedWith

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

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

Specified by:
getBeanPropertiesAnnotatedWith in interface SourceUtils
Parameters:
annotation -
type -
Returns:

getAbstractBeanProperties

public Set<SourceUtils.BeanProperty> getAbstractBeanProperties(TypeElement type)
Description copied from interface: SourceUtils

Specified by:
getAbstractBeanProperties in interface SourceUtils
Returns:

getBeanProperty

public SourceUtils.BeanProperty getBeanProperty(ClassName type,
                                                String name)
Description copied from interface: SourceUtils

Get bean property descriptor for particular type.

Specified by:
getBeanProperty in interface SourceUtils
Returns:

getBeanProperty

public SourceUtils.BeanProperty getBeanProperty(TypeElement type,
                                                String name)
Description copied from interface: SourceUtils

Get bean property descriptor for particular type.

Specified by:
getBeanProperty in interface SourceUtils
Returns:

getDocComment

public String getDocComment(Element componentElement)
Description copied from interface: SourceUtils

Get JavaDoc comments associated with given element.

Specified by:
getDocComment in interface SourceUtils
Returns:

getAnnotationMirror

public AnnotationMirror getAnnotationMirror(Element element,
                                            Class<? extends Annotation> annotationType)
Description copied from interface: SourceUtils

Get model representation of the annotation for given model element

Specified by:
getAnnotationMirror in interface SourceUtils
Returns:

isAnnotationPresent

public boolean isAnnotationPresent(Element element,
                                   Class<? extends Annotation> annotationType)
Description copied from interface: SourceUtils

Check model element for presense of annotation.

Specified by:
isAnnotationPresent in interface SourceUtils
Returns:

isAnnotationPropertyPresent

public boolean isAnnotationPropertyPresent(AnnotationMirror annotation,
                                           String propertyName)
Description copied from interface: SourceUtils

Specified by:
isAnnotationPropertyPresent in interface SourceUtils
Returns:

isDefaultValue

public boolean isDefaultValue(AnnotationMirror annotation,
                              String propertyName)
Description copied from interface: SourceUtils

Check annotation proprrty for default value.

Specified by:
isDefaultValue in interface SourceUtils
Returns:
true if property has its default value.

getAnnotationValue

public <T> T getAnnotationValue(AnnotationMirror annotation,
                                String propertyName,
                                Class<T> expectedType)
Description copied from interface: SourceUtils

Specified by:
getAnnotationValue in interface SourceUtils
Returns:

getAnnotationValues

public <T> Iterable<T> getAnnotationValues(AnnotationMirror annotation,
                                           String propertyName,
                                           Class<T> expectedType)
Description copied from interface: SourceUtils

Specified by:
getAnnotationValues in interface SourceUtils
Returns:

setModelProperty

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

Set model property to the corresponding annotation attribute, if annotation attribute set to non-default value.

Specified by:
setModelProperty in interface SourceUtils
Parameters:
model - Model object.
annotation - annotation to copy property from.
modelProperty - bean attribute name in the model and annotation.

setModelProperty

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

Set model property to the corresponding annotation attribute, if annotation attribute set to non-default value.

Specified by:
setModelProperty in interface SourceUtils
Parameters:
model - Model object.
annotation - annotation to copy property from.
modelProperty - bean attribute name in model.
annotationAttribute - annotation attribute name.

getConstant

public Object getConstant(TypeElement componentElement,
                          String name)
Description copied from interface: SourceUtils

Specified by:
getConstant in interface SourceUtils
Returns:

visitSupertypes

public void visitSupertypes(TypeElement type,
                            SourceUtils.SuperTypeVisitor visitor)
Description copied from interface: SourceUtils

Specified by:
visitSupertypes in interface SourceUtils

isClassExists

public boolean isClassExists(ClassName type)
Description copied from interface: SourceUtils

Specified by:
isClassExists in interface SourceUtils
Returns:
true if class already exist in project source or dependent libraries.

asTypeElement

public TypeElement asTypeElement(TypeMirror mirror)
Description copied from interface: SourceUtils

Converts TypeMirror into corresponding TypeElement

Specified by:
asTypeElement in interface SourceUtils
Returns:
The Element for given type

RichFaces CDK Generator 4.2.0.CR1

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