public MutableAnnotationMirror toMutableAnnotation(Class<?> clazz, String name, Object value) { MutableAnnotation mutableAnnotation = new MutableAnnotation(toMutableType(clazz), processingEnv); mutableAnnotation.setAnnotationValue(name, processingEnv.getTypeUtils().getTypeValue(value)); return mutableAnnotation; }
protected TypeMirror unboxType(TypeMirror type) { try { return processingEnv.getTypeUtils().unboxedType(type); } catch (Exception e) { return type; } }
private void dirty() { if (type != null) { processingEnv.getTypeUtils().invalidateCache(type); } type = null; }
@Override protected MutableDeclaredType getDelegate() { return processingEnv.getTypeUtils().getDeclaredType( processingEnv.getTypeUtils().toMutableType(BeanWrapper.class), new MutableDeclaredType[] { bean }); } }
public MutableVariableElement getParameterElement(Class<?> clazz, String name) { return new MutableParameter(MutableElementKind.PARAMETER, processingEnv.getTypeUtils().toMutableType(clazz), name, processingEnv); }
public ParameterElement(MutableTypeMirror type, String name, MutableType usage, PropagationType propagationType, MutableProcessingEnvironment processingEnv) { this.type = type; this.name = name; this.propagationType = propagationType; if (usage != null) { this.usage = usage; } else { this.usage = processingEnv.getTypeUtils().getReference(null, name); } this.usageProvider = null; }
public MutableAnnotationAccessor(Class<?> annotationClazz, MutableProcessingEnvironment processingEnv) { super(processingEnv); this.mutableAnnotation = processingEnv.getTypeUtils().toMutableAnnotation(annotationClazz); this.processingEnv = processingEnv; }
public MutableAnnotationMirror toMutableAnnotation(Class<?> clazz) { return new MutableAnnotation(toMutableType(clazz), processingEnv); }
@Override public MutableExecutableType getConstructor() { if (constructor == null) { MutableMethod constructorMethod = new MutableMethod(processingEnv, getSimpleName()); constructorMethod.addModifier(Modifier.PUBLIC); constructorMethod.setDefault(true); constructor = constructorMethod; } return constructor; }
public MutableProcessingEnvironment(ProcessingEnvironment processingEnvironment, Class<?> clazz, List<MutableDeclaredType> usedTypes) { this.processingEnvironment = processingEnvironment; this.printSupport = getPrintSupport(clazz); this.usedTypes = usedTypes; this.elements = new MutableElements(this, processingEnvironment.getElementUtils()); this.types = new MutableTypes(this, elements, processingEnvironment.getTypeUtils()); }
private MutableTypeValue[] toTypeValues(MutableTypeMirror componentType, Object... values) { MutableTypeValue[] arrayValues = new MutableTypeValue[values.length]; int i = 0; for (Object value: values) { arrayValues[i++] = getTypeValue(componentType, value); } return arrayValues; }
public MutableDeclaredType setSimpleName(String simpleName) { dirty(); invalidateEnclosedType(); this.simpleName = simpleName; return this; }
@Override public HasAnnotations setAnnotations(MutableAnnotationMirror... annotations) { return annotationHolderDelegate.setAnnotations(annotations); } }
MutableExecutable(ExecutableElement executableElement, MutableProcessingEnvironment processingEnv) { super(MutableElementKind.EXECUTABLE, processingEnv); this.executableElement = executableElement; this.annotationHolderDelegate = new AnnotationHolderDelegate(processingEnv, executableElement); }
public MutableDeclaredType setKind(MutableTypeKind kind) { dirty(); this.kind = kind; return this; }
@Override protected MutableReferenceType getConverterProviderContextReference() { return processingEnv.getTypeUtils().getReference(null, THIS); } };
protected TypeMirror unboxType(TypeMirror type) { try { return processingEnv.getTypeUtils().unboxedType(type); } catch (Exception e) { return type; } }
@Override public HasAnnotations setAnnotations(MutableAnnotationMirror... annotations) { annotationHolderDelegate.setAnnotations(annotations); return this; }
@Override protected MutableReferenceType getConverterProviderContextReference() { return processingEnv.getTypeUtils().getReference(null, THIS); } };
protected TypeMirror unboxType(TypeMirror type) { try { return processingEnv.getTypeUtils().unboxedType(type); } catch (Exception e) { return null; } }